/** This class demonstrates the advanced techniques in BinarySearchTree2. */ public class TreeTester2 { public static void main(String[] args) { BinarySearchTree2 students = new BinarySearchTree2<>(); // Can form BinarySearchTree2 even though Student // implements Comparable and not Comparable students.add(new Student("Romeo", "Art History")); students.add(new Student("Juliet", "CS")); students.add(new Student("Tom", "Leisure Studies")); students.add(new Student("Diana", "EE")); students.add(new Student("Harry", "Biology")); class PrintVisitor implements Visitor { public void visit(Object data) { System.out.println(data); } } // Can pass a Visitor, not just a Visitor students.inorder(new PrintVisitor()); } }