class AllocationUtils {

    public static <T> List<List<T>> getPermutations(List<List<T>> possibilities, int max) {
        List<List<T>> results = new ArrayList<>();
        getPermutations(possibilities, results, 0, new ArrayList<>(), max);
        return results;
    }

}