Split list into multiple lists with fixed number of elements in java 8

You can use Guava library.

List<Integer> bigList = ...
List<List<Integer>> smallerLists = Lists.partition(bigList, 10);

Leave a Comment