int[] sortEncodedSet(int[] encodedSet, int validIndex) {
        int[] result = new int[validIndex];
        for (int i = 0; i < validIndex; ++i) {
            result[i] = transformToSortRepresentation(encodedSet[i]);
        }

        Arrays.sort(result);

        for (int i = 0; i < validIndex; ++i) {
            result[i] = transformFromSortRepresentation(result[i]);
        }

        return result;
    }
@Test
    public void testSortEncodedSet() {
        int[] testSet = new int[3];
        testSet[0] = 655403;
        testSet[1] = 655416;
        testSet[2] = 655425;
        HyperLogLogPlus hyperLogLogPlus = new HyperLogLogPlus(14, 25);
        testSet = hyperLogLogPlus.sortEncodedSet(testSet, 3);
        assertEquals(655403, testSet[0]);
        assertEquals(655425, testSet[1]);
        assertEquals(655416, testSet[2]);

    }