strikt-core / strikt.assertions / exactly

exactly

fun <T : Iterable<E>, E> Builder<T>.exactly(count: Int, predicate: Builder<E>.() -> Unit): Builder<T>

Asserts that exactly count elements of the subject pass the assertions in predicate.