partition

fun <T> Iterator<T>.partition(size: Int, cutIncomplete: Boolean = false): Iterator<List<T>>

Partitions the values of the iterator lazily in groups of size.