SplayTree { public boolean find(int key) { splay(key); return root.key == key; }  void add(int key, Object elem); boolean find(int key); void delete(int elem);  }
@Test public void testFind() throws Exception { for (int n = 0; n < 10; n++) { for (int i = 0; i < inserted.length; i++) { assertTrue(tree.find(inserted[i])); } } for (int i = 0; i < 1000; i++) { assertFalse(tree.find(rand.nextInt(inserted.length) + inserted.length + 1)); } }