public static List<List<Expr>> candidateOfPartitionByExprs(List<List<Expr>> partitionByExprs) {
        if (partitionByExprs.isEmpty()) {
            return Lists.newArrayList();
        }
        PermutationGenerator generator = new PermutationGenerator<Expr>(partitionByExprs);
        int totalCount = 0;
        List<List<Expr>> candidates = Lists.newArrayList();
        while (generator.hasNext() && totalCount < 8) {
            candidates.add(generator.next());
            totalCount++;
        }
        return candidates;
    }
@Test
    public void testPermutaionsOfPartitionByExprs3() throws Exception {
        List<List<Expr>> slotRefs = createSlotRefArray(4, 5);
        for (List<Expr> refs: slotRefs) {
            System.out.println(slotRefsToInt(refs));
        }
        List<List<Expr>> newSlotRefs = PlanNode.candidateOfPartitionByExprs(slotRefs);
        Assert.assertTrue (newSlotRefs.size() == 8);
        for (List<Expr> candidates: newSlotRefs) {
            System.out.println(slotRefsToInt(candidates));
        }
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(0), Arrays.asList(0, 5, 10, 15)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(1), Arrays.asList(0, 5, 10, 16)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(2), Arrays.asList(0, 5, 10, 17)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(3), Arrays.asList(0, 5, 10, 18)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(4), Arrays.asList(0, 5, 10, 19)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(5), Arrays.asList(0, 5, 11, 15)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(6), Arrays.asList(0, 5, 11, 16)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(7), Arrays.asList(0, 5, 11, 17)));
    }