List of utility methods to do List Partition
List
| splitListByPartitionSize(List> list, int partitionSize) to split a list into lists with equally sized List<List<?>> partitionList = new ArrayList<>(); for (int i = 0; i < list.size(); i += partitionSize) { List subList = new ArrayList(list.subList(i, Math.min(i + partitionSize, list.size()))); partitionList.add(subList); return partitionList; |