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 testPermutaionsOfPartitionByExprs2() throws Exception {
        List<List<Expr>> slotRefs = createSlotRefArray(1, 3);
        for (List<Expr> refs: slotRefs) {
            System.out.println(slotRefsToInt(refs));
        }
        List<List<Expr>> newSlotRefs = PlanNode.candidateOfPartitionByExprs(slotRefs);
        Assert.assertTrue(newSlotRefs.size() == 3);
        for (List<Expr> candidates: newSlotRefs) {
            System.out.println(slotRefsToInt(candidates));
        }

        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(0), Arrays.asList(0)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(1), Arrays.asList(1)));
        Assert.assertTrue(slotRefsEqualTo(newSlotRefs.get(2), Arrays.asList(2)));
    }