@Override
    public V remove(K key)
    {
        if (key == null)
        {
            throw new IllegalArgumentException();
        }
        int i;
        for (i = index(key); keys[i] != null && !key.equals(keys[i]); i = (i + 1) % keys.length);
        if (keys[i] == null)
        {
            return null;
        }
        V value = values[i];
        keys[i] = null;
        values[i] = null;
        --size;
        i = (i + 1) % keys.length;
        while (keys[i] != null)
        {
            K k = keys[i];
            V v = values[i];
            keys[i] = null;
            values[i] = null;
            --size;
            add(k, v);
            i = (i + 1) % keys.length;
        }
        if (size <= keys.length / 8 && keys.length / 2 > size)
        {
            resize(keys.length / 2);
        }
        return value;
    }