@Override
    public V remove(Object key) {
        checkNotNull(key, "Key can not be null.");
        V removed = get(key);
        items.remove(serializer.encode(key));
        return removed;
    }
@Test
    public void testRemove() throws Exception {
        //Checks removal and return values
        fillMap(10);
        assertEquals(10, map.size());
        for (int i = 0; i < 10; i++) {
            assertEquals("The previous value was wrong.", Integer.valueOf(i), map.remove(i));
            assertNull("The previous value was wrong.", map.remove(i));
            //(i+1) compensates for base zero.
            assertEquals("The size was wrong.", 10 - (i + 1), map.size());
        }
    }