### Question:
RedBlackTree { public RedBlackNode<K,V> findFirstNode(K key) { RedBlackNode<K,V> node = root; RedBlackNode<K,V> bestNode = null; while(node != null) { int comp = comparator.compare(key, node.key); if (comp == 0) { bestNode = node; } if (comp <= 0) { node = node.left; } else { node = node.right; } } return bestNode; } 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 testFindFirst() { RedBlackNode<Integer,String> node = tree.findFirstNode(7); assertNotNull(node); assertEquals(7, (int)node.key); node = tree.findFirstNode(8); assertNull(node); node = treeWithDups.findFirstNode(7); assertNotNull(node); assertEquals(7, (int)node.key); node = tree.findFirstNode(8); assertNull(node); node = tree.findFirstNode(5); assertNotNull(node); assertEquals("five", node.getValue()); }