Im suppose to make a preOrder transversal method so that it performs a preOrder transversal of the tree. For each node it traverses, it should call sb.append() to add a \"[\" the results of traversing the subtree rooted at that node, and then a \"]\". You should add a space before the results of the left and right child traversals, but only if the node exists. This is what i have so far public class BinarySearchTree> extends AbstractSet { protected Entry root; protected int size; /** * Initializes this BinarySearchTree object to be empty, to contain only * elements of type E, to be ordered by the Comparable interface, and to * contain no duplicate elements. */ public BinarySearchTree() { root = null; size = 0; } /** * Initializes this BinarySearchTree object to contain a shallow copy of a * specified BinarySearchTree object. The worstTime(n) is O(n), where n is the * number of elements in the specified BinarySearchTree object. * * @param otherTree - the specified BinarySearchTree object that this * BinarySearchTree object will be assigned a shallow copy of. */ public BinarySearchTree(BinarySearchTree otherTree) { root = copy(otherTree.root, null); size = otherTree.size; } /* Method to complete is here! */ public void preOrder(Entry ent, StringBuilder sb) { // TODO: Complete me! if(ent == null){ return; } if(ent.left != null){ sb.append(\"[\"); preOrder(ent.left, sb); } if(ent.right != null){ sb.append(\"[\"); preOrder(ent.right, sb); } sb.append(\"]\"); } But my preOrder method gives me these errors The following hint(s) may help you locate some ways in which your solution may be improved: --Pre-order traversal should process the root, then its left child (and exclude the non-existent right child)! Expected [t [o]], but was []] --Should just include the root\'s element when the tree only has 1 element! Expected [z], but was ] --Pre-order traversal should process the root, ignore the non-existent left child, then process the right child! Expected [w [z]]. but was []] --Pre-order traversal should process the root, the left child, and then the right child! Expected [9 [0] [d]], but was [][]] --Pre-order traversal should process the root, and then the left child. In processing the left child, it should process that node first, and then process its children! Expected [d [9 [d]]], but was [[]]] --Pre-order traversal should process the root, and then the right child. In processing the right child, it should process that node first, and then process its children! Expected [v [w [z]]], but was [[]]] --Pre-order traversal should process a node and then recursively process each of its children! Expected [v [d [9 [0] [d]] [j [g] [t [o]]]] [w [z]]], but was [[[][]][[][[]]]][[]]] --Pre-order traversal should process a node and then recursively process each of its children! Expected [v [d [9 [0] [d]] [j [g] [t]]]], but was [[[][]][[][]]]] Solution import java.util.Stack; /* Class containing left and right child of current node and key value*/ class Node { i.