@Override
  public RedBlackTree.Node<T> delete(T value) {
    if (head != null && head.getValue().equals(value)) {
      head = getSuccessor(head);
    }
    RedBlackTree.Node<T> result = super.delete(value);
    if (result != null) {
      Node<T> linkedNode = (Node<T>) result;
      if (linkedNode.getPredecessor() != null)
        linkedNode.getPredecessor().setSuccessor(linkedNode.getSuccessor());
      if (linkedNode.getSuccessor() != null)
        linkedNode.getSuccessor().setPredecessor(linkedNode.getPredecessor());
    }

    return result;
  }