private BitSet genRandomBitSet(final int size, final int cardinality) {
        BitSet result = new BitSet(size);
        int[] chosen = new int[cardinality];
        int i;
        for (i = 0; i < cardinality; ++i) {
            chosen[i] = i;
            result.set(i);
        }
        Random random = new Random();
        for (; i < size; ++i) {
            int j = random.nextInt(i + 1);
            if (j < cardinality) {
                result.clear(chosen[j]);
                result.set(i);
                chosen[j] = i;
            }
        }
        return result;
    }
@Test
    public void testGenRandomBitSet() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Method method = countSampler.getClass().getDeclaredMethod("genRandomBitSet", int.class, int.class);
        method.setAccessible(true);
        BitSet bitSet = (BitSet) method.invoke(countSampler, 1, 1);
        BitSet res = new BitSet(1);
        res.set(0);
        Assertions.assertEquals(bitSet, res);
    }