### Question:
RedBlackTree { public boolean containsKey(K key) { RedBlackNode<K,V> node = root; while(node != null) { int comp = comparator.compare(key, node.key); if (comp == 0 ){ return true; } if (comp < 0) { node = node.left; } else { node = node.right; } } return false; } RedBlackTree(Comparator<K> comparator, boolean allowDuplicateKeys);  RedBlackTree(RedBlackTree<K, V> tree); @Override String toString(); int size(); boolean containsKey(K key); RedBlackNode<K,V> getFirst(); RedBlackNode<K,V> getLast(); RedBlackNode<K,V> lowerBound(K key); RedBlackNode<K,V> upperBound(K key); Pair<RedBlackNode<K, V>, Boolean> put(K key, V value); RedBlackNode<K,V> findFirstNode(K key); RedBlackNode<K,V> findLastNode(K key); V remove(K key); void removeAll(); boolean isEmpty(); void deleteEntry(RedBlackNode<K,V> p); static final String EOL; }### Answer:
@Test public void testContains() { assertTrue(tree.containsKey(1)); assertTrue(tree.containsKey(2)); assertTrue(tree.containsKey(3)); assertTrue(tree.containsKey(4)); assertTrue(tree.containsKey(5)); assertTrue(tree.containsKey(6)); assertTrue(tree.containsKey(7)); assertTrue(tree.containsKey(9)); assertTrue(tree.containsKey(10)); assertTrue(!tree.containsKey(0)); assertTrue(!tree.containsKey(11)); assertTrue(!tree.containsKey(8)); assertTrue(treeWithDups.containsKey(1)); assertTrue(treeWithDups.containsKey(2)); assertTrue(treeWithDups.containsKey(3)); assertTrue(treeWithDups.containsKey(4)); assertTrue(treeWithDups.containsKey(5)); assertTrue(treeWithDups.containsKey(6)); assertTrue(treeWithDups.containsKey(7)); assertTrue(treeWithDups.containsKey(9)); assertTrue(treeWithDups.containsKey(10)); assertTrue(!treeWithDups.containsKey(0)); assertTrue(!treeWithDups.containsKey(11)); assertTrue(!treeWithDups.containsKey(8)); }