@Override
    public Object[] toArray() {
        Object[] retArray = new Object[items.size()];
        int index = 0;
        for (byte[] item : items) {
            retArray[index] = serializer.decode(item);
            index++;
        }
        return retArray;
    }
@Test
    public void testToArray() throws Exception {
        //Test creation of a new array of the values
        fillSet(10, set);
        Object[] arr = set.toArray();
        assertEquals("The array should be of length 10.", 10, arr.length);
        for (int i = 0; i < 10; i++) {
            assertTrue("All elements of the array should be in the set.", set.contains(arr[i]));
        }
    }