Listings for BinaryHeap.java and BinaryHeapTest.java are shown in the menu at left Everything in the BinaryHeap class has been written except the add and remove methods, which you must write: First, implement add, then run the test class and observe the testAdd results Next, implement remove, then run the test class and observe the testRemove results testAdd and testRemove should both run without errors Note: A comp object implementing the Comparator interface is passed to the binary heap\'s constructor. You will need to use the comp object\'s compare method when making comparisons in the add and remove operations. The parent, leftChild, and rightChild methods in BinaryHeapTest are for testing purposes only, and should not be used to implement add and remove Solution BinaryHeapTest.java import java.util.Comparator; import org.junit.Test; import static org.junit.Assert.*; public class BinaryHeapTest { /** * A binary heap of Integer objects */ private BinaryHeap bh; /** * Some Integer nodes for testing */ private Integer n1, n2, n3, n4, n5, n6, n7, n8, n9, n10; /** * An object for comparing Integer nodes */ private Comparator comp; public BinaryHeapTest() { comp = new Comparator() { public int compare(Integer t, Integer t1) { return t.compareTo(t1); } }; bh = new BinaryHeap(10, comp); n1 = new Integer(1); n2 = new Integer(2); n3 = new Integer(3); n4 = new Integer(4); n5 = new Integer(5); n6 = new Integer(6); n7 = new Integer(7); n8 = new Integer(8); n9 = new Integer(9); n10 = new Integer(10); } @Test public void testAdd() { buildHeap(); assertTrue(leftChild(n1) == n2); assertTrue(rightChild(n1) == n5); assertTrue(leftChild(n2) == n4); assertTrue(rightChild(n2) == n3); assertTrue(leftChild(n5) == n9); assertTrue(rightChild(n5) == n6); assertTrue(leftChild(n4) == n10); assertTrue(rightChild(n4) == n7); assertTrue(leftChild(n3) == n8); assertTrue(rightChild(n3) == null); assertTrue(leftChild(n9) == null); assertTrue(rightChild(n9) == null); assertTrue(leftChild(n6) == null); assertTrue(rightChild(n6) == null); assertTrue(parent(n10) == n4); assertTrue(parent(n7) == n4); assertTrue(parent(n8) == n3); assertTrue(parent(n4) == n2); assertTrue(parent(n3) == n2); assertTrue(parent(n9) == n5); assertTrue(parent(n6) == n5); assertTrue(parent(n2) == n1); assertTrue(parent(n5) == n1); assertTrue(parent(n1) == null); } /** * An auxiliary method that builds a heap that should look like: * * 1 * / \\ * 2 5 * / \\ / \\ * 4 3 9 6 * / \\ / * 10 7 8 */ private void buildHeap() { bh.clear(); assertTrue(bh.isEmpty()); bh.add(n10); bh.add(n9); bh.add(n8); bh.add(n7); bh.add(n6); bh.add(n5); bh.add(n4); bh.add(n3); bh.add(n2); bh.add(n1); assertTrue(bh.size() == 10); } @Test public void testRemove() { buildHeap(); assertTrue(bh.remove() == n1); assertTrue(bh.remove() == n2); assertTrue(bh.remove() == n3); assertTrue(bh.remove() == n4); assertTrue(bh.remove() == n5); assertTrue(bh.remove() == n6); assertTrue(bh.remove() == n7); assertTrue(bh.remove() == n8); assertTru.