code: private E remove(final int index, final K key) {
      if (entries[index] == null) {
        return null;
      } else if (entries[index].equals(key)) {
        //remove the head of the linked list
        modification++;
        size--;
        final LinkedElement e = entries[index];
        entries[index] = e.getNext();
        e.setNext(null);
        return convert(e);
      } else {
        //head != null and key is not equal to head
        //search the element
        LinkedElement prev = entries[index];
        for(LinkedElement curr = prev.getNext(); curr != null; ) {
          if (curr.equals(key)) {
            //found the element, remove it
            modification++;
            size--;
            prev.setNext(curr.getNext());
            curr.setNext(null);
            return convert(curr);
          } else {
            prev = curr;
            curr = curr.getNext();
          }
        }
        //element not found
        return null;
      }
    }
docs: Remove the element corresponding to the key,
  given key.hashCode() == index.
  
  @return If such element exists, return it.
  Otherwise, return null.