AbstractBinarySearchTree extends AbstractSearchTree<E, N> { @Override public N find(E value) { return find(getRoot(), value); } protected  AbstractBinarySearchTree(Comparator<E> comparator, TreeNodeFactory<E, N> factory); @Override N find(E value); @Override N find(N root, E value); @Override N minimum(); @Override N minimum(N root); @Override N maximum(); @Override N maximum(N root); @Override N predecessor(N node); @Override N successor(N node); @Override N insert(E value); @Override List<N> delete(E... values); @Override N delete(E value);  }
@Test public void testFindingByValue() throws Exception { final BinaryTreeNode<Integer> four = create(18); final BinaryTreeNode<Integer> three = create(20, four, null); final BinaryTreeNode<Integer> two = create(13); final BinaryTreeNode<Integer> one = create(4); final BinaryTreeNode<Integer> root = create(10, create(7, one, create(8)), create(16, two, three)); final AbstractBinarySearchTree<Integer, BinaryTreeNode<Integer>> tree = tree(root); assertThat(tree.find(10), is(notNullValue())); assertThat(tree.find(10), is(root)); assertThat(tree.find(18), is(four)); assertThat(tree.find(four, 18), is(four)); assertThat(tree.find(three, 18), is(four)); assertThat(tree.find(-1), is(nullValue())); assertThat(tree.find(two, 18), is(nullValue())); assertThat(tree.find(13), is(two)); assertThat(tree.find(4), is(one)); }