code: public static <T> List<Partition<T>> getPartitions(List<T> list, Integer... elementCounts) {
  		int totalCount = 0;
  		for (Integer elements : elementCounts)
  			totalCount += elements;
  		if (totalCount != list.size())
  			return null;
  		Integer[] cuts = new Integer[elementCounts.length - 1];
  		for (int i = 0; i < elementCounts.length - 1; i++)
  			cuts[i] = elementCounts[i] + (i == 0 ? 0 : cuts[i - 1]);
  		List<Partition<T>> result = new ArrayList<>();
  		Iterator<List<T>> permutations = getPermutations(list);
  		while (permutations.hasNext()) {
  			Partition<T> part = new Partition<>(list);
  			List<List<T>> dividedList = divideListPos(permutations.next(), cuts);
  			for (List<T> l : dividedList)
  				part.addSubset(l);
  			result.add(part);
  		}
  		return result;
  	}
docs: Generates all partitions with the given number of elements per partition.<br>
  @param list The basic list for partition generation
  @param elementCounts element counts per partition
  @return