@Override
    public V remove(K key) {
        int hash = hash(key, this.array);
        Entry<K, V> entry = this.array[hash];
        V value = null;
        if (entry == null) {
            return value;
        }
        if (entry.next == null) {
            if (entry.key.equals(key)) {
                value = entry.data;
                this.array[hash] = null;
                size--;
                return value;
            }
        } else {
            if (entry.key.equals(key)) {
                value = entry.data;
                this.array[hash] = entry.next;
                size--;
                return value;
            }
            Entry<K, V> nextEntry = entry.next;
            while (nextEntry != null) {
                if (nextEntry.key.equals(key)) {
                    value = nextEntry.data;
                    entry.next = nextEntry.next;
                    size--;
                    return value;
                }
                entry = nextEntry;
                nextEntry = nextEntry.next;
            }
        }
        return value;
    }