@Override
    public V add(K key, V value)
    {
        if (key == null || value == null)
        {
            throw new IllegalArgumentException();
        }
        if (size >= keys.length / 2)
        {
            resize(keys.length * 2);
        }
        int i;
        for (i = index(key); keys[i] != null; i = (i + 1) % keys.length)
        {
            if (key.equals(keys[i]))
            {
                V old = values[i];
                values[i] = value;
                return old;
            }
        }
        keys[i] = key;
        values[i] = value;
        ++size;
        return null;
    }