SplayTree { public void add(int key, Object elem) { if (root == null) root = new SplayNode(key, elem, null); else root.add(key, elem); }  void add(int key, Object elem); boolean find(int key); void delete(int elem);  }
@Test public void testAdd() throws Exception { for (int i = 0; i < n; i++) { inserted[i] = rand.nextInt(); tree.add(inserted[i], null); assertTrue(tree.find(inserted[i])); } }