code: public static <T> Iterable<List<T>> partition(
              final Iterable<T> iterable, final int initialSize, final int minSize, final int maxSize,
              final Duration iterationGoal) {
          return new Iterable<List<T>>() {
              @Override
              public Iterator<List<T>> iterator() {
                  return new TimePartitioningIterator<>(
                          iterable.iterator(), initialSize, minSize, maxSize, iterationGoal);
              }
          };
      }
docs: Partitions the specified iterable, adjusting the size of each partition with the goal of making each
  iteration take time equal to the {@code iterationGoalMillis}.  This works best when the amount of
  work done between each call to {@link #hasNext()} is linear with respect to the size of the partition.