@Test void testContains() { assertThat(TREE.nodes().stream() .allMatch(TREE::contains)).isTrue(); assertThat(TREE.contains(99)).isFalse(); }
public final boolean contains(int value) { return find(value) != null; }
BinarySearchTree { public final boolean contains(int value) { return find(value) != null; } }
BinarySearchTree { public final boolean contains(int value) { return find(value) != null; } @Builder private  BinarySearchTree(Integer root, @Singular List<Integer> nodes); }
BinarySearchTree { public final boolean contains(int value) { return find(value) != null; } @Builder private  BinarySearchTree(Integer root, @Singular List<Integer> nodes); ParentAwareIntegerNode root(); List<Integer> nodes(); final ParentAwareIntegerNode insert(int value); final boolean contains(int value); final ParentAwareIntegerNode delete(int value); }
BinarySearchTree { public final boolean contains(int value) { return find(value) != null; } @Builder private  BinarySearchTree(Integer root, @Singular List<Integer> nodes); ParentAwareIntegerNode root(); List<Integer> nodes(); final ParentAwareIntegerNode insert(int value); final boolean contains(int value); final ParentAwareIntegerNode delete(int value);  }