@Test
    public void takeKFromListRandom() {
        for (int i = 0; i < 1000; i++) {
            List<Integer> integers = new ArrayList<Integer>();
            long seed = System.currentTimeMillis();
            Random random = new Random(seed);

            int listSize = random.nextInt(13) + 1;
            int k = random.nextInt(listSize) + 1;

            for (int j = 1; j <= listSize; j++) {
                integers.add(j);
            }
            List<List<Integer>> result = Combination.takeKFromList(integers, k);

            // Checking that we have the right amount of combinations
            assertEquals("Wrong amount of combinations with n = " + listSize + " and k = " + k
                    + " using seed " + seed, Combination.countNumberOfCombinations(listSize, k), result.size());

            /* Checking that all combinations are of the right size and that          
             * all combinations are different
             */
            for (int m = 0; m < result.size(); m++) {
                Set<Integer> combination = new HashSet<Integer>(result.get(m));
                assertEquals("Combination " + combination + " is of wrong size when n = "
                        + listSize + " and k = " + k, k, combination.size());
                for (int l = m + 1; l < result.size(); l++) {
                    Set<Integer> otherCombination = new HashSet<Integer>(result.get(l));
                    assertFalse("Combinations " + combination + " and " + otherCombination + " match", 
                            combination.equals(otherCombination));
                }
            }
        }
    }