partitionIndexed method Null safety
- IndexedPredicate<
E> test
Splits this collection into pair (Tuple2
) of lazy iterables,
where item1
contains elements for which test
yields true
,
while item2
contains elements for which test
yields false
,
comparing to partition
, test
will has access to the sequential index of each element.
Implementation
Tuple2<Iterable<E>, Iterable<E>> partitionIndexed(IndexedPredicate<E> test) =>
Tuple2(whereIndexed(test), whereNotIndexed(test));