docs: public synchronized void removeElement(T element) {
      checkArgument(
          element.getNext() != null || element.getPrev() != null || element == head,
          "Element not in the list.");
      size--;
      T prev = element.getPrev();
      T next = element.getNext();
      if (prev == null) {
        // This is the first element
        head = next;
        if (head != null) {
          // If more than one element in the list.
          head.setPrev(null);
          element.setNext(null);
        }
      } else if (next == null) {
        // This is the last element, and there is at least another element because
        // element.getPrev() != null.
        prev.setNext(null);
        element.setPrev(null);
      } else {
        prev.setNext(element.getNext());
        next.setPrev(element.getPrev());
        element.setNext(null);
        element.setPrev(null);
      }
    }