@NonNull static fun <A : Any!> partition(@NonNull list: MutableList<A>, upperBound: Int): MutableList<MutableList<A>!>
Splits a List into Lists with an arity of 2 where each List has an inclusive upper bound on its size.
list
- MutableList<A>: List to transform.
upperBound
- Int: Inclusive upper bound on the size for each List.
IllegalArgumentException
- If the inclusive upper bound is less than 1.
Return
MutableList<MutableList<A>!>: Partitioned List.