@Override
    public boolean retainAll(Collection<?> c) {
        boolean changed = false;
        for (byte[] item : items) {
            E deserialized = serializer.decode(item);
            if (!c.contains(deserialized)) {
                changed = items.remove(item) || changed;
            }
        }
        return changed;
    }
@Test
    public void testRetainAll() throws Exception {
        //Test ability to generate the intersection set
        Set<Integer> retainSet = Sets.newHashSet();
        fillSet(10, set);
        assertTrue("The set should have changed.", set.retainAll(retainSet));
        assertTrue("The set should have been emptied.", set.isEmpty());
        fillSet(10, set);
        fillSet(10, retainSet);
        Set<Integer> duplicateSet = new HashSet<>(set);
        assertFalse("The set should not have changed.", set.retainAll(retainSet));
        assertEquals("The set should be the same as the duplicate.", duplicateSet, set);
        retainSet.remove(9);
        assertTrue("The set should have changed.", set.retainAll(retainSet));
        duplicateSet.remove(9);
        assertEquals("The set should have had the nine element removed.", duplicateSet, set);
    }