kotest-property / io.kotest.property.arbitrary / distinctBy

distinctBy

fun <A, B> Arb<A>.distinctBy(selector: (A) -> B): Arb<A>

Returns a new Arb which ensures only distinct keys returned by the given selector function are generated by keeping track of previously generated values.

Note: This arb can result in an infinite loop if more elements are requested than can be generated uniquely.