### Question:
RedBlackTree { public RedBlackNode<K,V> getFirst() { if (root == null) { return null; } RedBlackNode<K,V> node = root; while(node.left != null) { node = node.left; } return node; } 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 testGetNextNode() { RedBlackNode<Integer,String> node = tree.getFirst(); assertEquals("one", node.value); node = node.getSuccessor(); assertEquals("two", node.value); node = node.getSuccessor(); assertEquals("three", node.value); node = node.getSuccessor(); assertEquals("four", node.value); node = node.getSuccessor(); assertEquals("five", node.value); node = node.getSuccessor(); assertEquals("six", node.value); node = node.getSuccessor(); assertEquals("seven", node.value); node = node.getSuccessor(); assertEquals("nine", node.value); node = node.getSuccessor(); assertEquals("ten", node.value); node = node.getSuccessor(); assertNull(node); node = treeWithDups.getFirst(); assertEquals("one", node.value); node = node.getSuccessor(); assertEquals("one-a", node.value); node = node.getSuccessor(); assertEquals("one-b", node.value); node = node.getSuccessor(); assertEquals("one-c", node.value); node = node.getSuccessor(); assertEquals("two", node.value); node = node.getSuccessor(); assertEquals("three", node.value); node = node.getSuccessor(); assertEquals("four", node.value); node = node.getSuccessor(); assertEquals("five", node.value); node = node.getSuccessor(); assertEquals("five-a", node.value); node = node.getSuccessor(); assertEquals("five-b", node.value); node = node.getSuccessor(); assertEquals("five-c", node.value); node = node.getSuccessor(); assertEquals("six", node.value); node = node.getSuccessor(); assertEquals("seven", node.value); node = node.getSuccessor(); assertEquals("seven-a", node.value); node = node.getSuccessor(); assertEquals("nine", node.value); node = node.getSuccessor(); assertEquals("ten", node.value); node = node.getSuccessor(); assertNull(node); }