Divides an iterator into unmodifiable sublists of the given size (the final list may be smaller). For example, partitioning an iterator containing [a, b, c, d, e] with a partition size of 3 yields [[a, b, c], [d, e]] -- an outer iterator containing two inner lists of three and two el
(Iterator<T> iterator, int size)
| 550 | * @throws IllegalArgumentException if {@code size} is nonpositive |
| 551 | */ |
| 552 | public static <T> UnmodifiableIterator<List<T>> partition(Iterator<T> iterator, int size) { |
| 553 | return partitionImpl(iterator, size, false); |
| 554 | } |
| 555 | |
| 556 | /** |
| 557 | * Divides an iterator into unmodifiable sublists of the given size, padding |