docs: public static <E> ImmutableList<ImmutableList<E>> partitionAlmostEvenly(final List<E> list,
        final int partitions) {
      checkNotNull(list);
      checkArgument(partitions > 0,
          "Number of partitions must be positive");
      checkArgument(partitions <= list.size(),
          "Cannot request more partitions than there are list items");
  
      // Divide into partitions, with the remainder falling into the extra partitions
      final List<List<E>> prelimPartitions =
          Lists.partition(list, IntMath.divide(list.size(), partitions, RoundingMode.DOWN));
      // Create output
      final ImmutableList.Builder<ImmutableList<E>> ret = ImmutableList.builder();
  
      // If we evenly partitioned, just do the type conversion and return. The type conversion is
      // performed because Lists#partition returns list views.
      if (prelimPartitions.size() == partitions) {
        for (List<E> partition : prelimPartitions) {
          ret.add(ImmutableList.copyOf(partition));
        }
      } else {
        // Otherwise, distribute the extras
  
        // Make a builder for each output partition and the extras. The extras are anything in the
        // preliminary partitions after the number of partitions we actually want. Thus, the
        // first index of extras is the same as the number of partitions.
        final ImmutableList.Builder<ImmutableList.Builder<E>> builderOfBuilders =
            ImmutableList.builder();
        final ImmutableList.Builder<E> extrasBuilder = ImmutableList.builder();
        for (int i = 0; i < prelimPartitions.size(); i++) {
          if (i < partitions) {
            builderOfBuilders.add(ImmutableList.<E>builder().addAll(prelimPartitions.get(i)));
          } else {
            extrasBuilder.addAll(prelimPartitions.get(i));
          }
        }
        final ImmutableList<ImmutableList.Builder<E>> builders = builderOfBuilders.build();
        final ImmutableList<E> extras = extrasBuilder.build();
  
        // Distribute the extra elements. We cannot overrun the bounds of builders because the number
        // of extras is always at least one less than the number of builders (otherwise, we would've
        // just had larger partitions).
        int partitionIdx = 0;
        for (E item : extras) {
          builders.get(partitionIdx++).add(item);
        }
  
        // Fill in output
        for (ImmutableList.Builder<E> builder : builders) {
          ret.add(builder.build());
        }
      }
  
      final ImmutableList<ImmutableList<E>> finalPartitions = ret.build();
      checkState(finalPartitions.size() == partitions,
          "Partitioning failed: number of output partitions (" + finalPartitions.size()
              + ") does not match requested number (" + partitions + ")");
  
      return finalPartitions;
    }