code: public static <T> UnmodifiableIterator<List<T>> partition(Iterator<T> iterator, int size) {
      return partitionImpl(iterator, size, false);
    }
docs: Divides an iterator into unmodifiable sublists of the given size (the final list may be
  smaller). For example, partitioning an iterator containing {@code [a, b, c, d, e]} with a
  partition size of 3 yields {@code [[a, b, c], [d, e]]} -- an outer iterator containing two
  inner lists of three and two elements, all in the original order.
  
  <p>The returned lists implement {@link java.util.RandomAccess}.
  
  @param iterator the iterator to return a partitioned view of
  @param size the desired size of each partition (the last may be smaller)
  @return an iterator of immutable lists containing the elements of {@code iterator} divided into
  partitions
  @throws IllegalArgumentException if {@code size} is nonpositive