public A delete(A a) {
    assert a != null;

    Node n = find(a);

    if (n == null) {
      throw new NoSuchElementException(a + " not found");
    } else {
      if (n.right() == null) {
        sentinel.setLeft(n.left());
      } else {
        sentinel.setLeft(n.right());

        findMin();
        sentinel.left().setLeft(n.left());
      }

      return n.contents;
    }
  }