Test Code
This code demonstrates how to use the sort and search functions, construct, load, traverse and search.

We use Java's built-in "compareTo" method.
//Element type: Employee
//Key type: String (employee name)

//Comparator<E>
Comparator<Employee> sortFct;
sortFct = (emp1, emp2) -> emp1.getName().compareTo(emp2.getName());

//BiFunction<K, E, Integer>
BiFunction<String, Employee, Integer> searchFct;
searchFct = (nm, emp) -> nm.compareTo(emp.getName());

BST<Employee, String> tree;
tree = new BST<>(sortFct, searchFct);

//add three elements
tree.add(new Employee(10, "Kofi"));
tree.add(new Employee(15, "Asha"));
tree.add(new Employee(20, "Riya"));

tree.visitInOrder(elem -> prn(elem));
prn("");
tree.visitPreOrder(elem -> prn(elem));
prn("");
tree.visitPostOrder(elem -> prn(elem));
prn("");

Employee match = tree.search("Riya");
prn("Match for 'Riya': " + match);

Test Code Output
Asha (15)
Kofi (10)
Riya (20)

Kofi (10)
Asha (15)
Riya (20)

Asha (15)
Riya (20)
Kofi (10)

Match for 'Riya': Riya (20)