@Override
    public V put(K key, V value) {
        checkNotNull(key, "Key cannot be null.");
        checkNotNull(value, "Value cannot be null.");
        byte[] prevVal = items.put(serializer.encode(key), serializer.encode(value));
        if (prevVal == null) {
            return null;
        }
        return serializer.decode(prevVal);
    }
@Test public void testPut() throws Exception {
        //Tests insertion behavior (particularly the returning of previous value)
        fillMap(10);
        for (int i = 0; i < 10; i++) {
            assertEquals("Put should return the previous value", Integer.valueOf(i), map.put(i, i + 1));
        }
        assertNull(map.put(11, 11));
    }