groupBy

fun <K> groupBy(keySelector: (A) -> K): Map<K, List<A>>(source)

Group the population by the value of keySelector.