private static <T> List<List<T>> fillOutCombinations(int k, List<List<T>> currentCombinations, Map<Integer, Integer> currentLargestIndexInThisCombination, List<T> list) {
        List<List<T>> previousCombinations;
        Map<Integer, Integer> previousLargestIndexInThisCombination;
        // Looping to add the necessary amount of elements to each list.
        int howManyAdded = 1;
        while (howManyAdded < k) {
            previousCombinations = currentCombinations;
            previousLargestIndexInThisCombination = currentLargestIndexInThisCombination;
            currentCombinations = new ArrayList<List<T>>();            
            currentLargestIndexInThisCombination = new HashMap<Integer,Integer>();
            
            // We check every previous list and add remaining elements with larger index.  
            for (int i = 0; i < previousCombinations.size(); i++) {
                List<T> combination = previousCombinations.get(i);
                int nextIndex = previousLargestIndexInThisCombination.get(i) + 1;
                for (int j = nextIndex; j < list.size() + howManyAdded - k + 1; j++) {
                    List<T> newCombination = new ArrayList<T>(combination);
                    newCombination.add(list.get(j));
                    currentCombinations.add(newCombination);
                    currentLargestIndexInThisCombination.put(currentCombinations.size() - 1, j);
                }                
            }
            howManyAdded++;
        }
        return currentCombinations;
    }