### Question:
RedBlackTree implements Iterable<RedBlackEntry<K, V>> { public V put(K key, V value) { RedBlackEntry<K, V> node = getOrCreateEntry(key); V oldValue = node.getValue(); node.setValue(value); return oldValue; } RedBlackTree(); int size(); boolean containsKey(K key); RedBlackEntry<K, V> getFirst(); RedBlackEntry<K, V> getLast(); RedBlackEntry<K, V> getEntryLessThanEqual(K key); RedBlackEntry<K, V> getEntryGreaterThanEqual(K key); V put(K key, V value); RedBlackEntry<K, V> getOrCreateEntry(K key); RedBlackEntry<K, V> getEntry(K key); V remove(K key); void removeNode(RedBlackEntry<K, V> node); void removeAll(); boolean isEmpty(); @Override ListIterator<RedBlackEntry<K, V>> iterator(); ListIterator<RedBlackEntry<K, V>> iterator(boolean forward); @SuppressWarnings("unchecked") ListIterator<RedBlackEntry<K, V>> iterator(RedBlackEntry<K, V> firstEntry,
			boolean forward); ListIterator<RedBlackEntry<K, V>> iterator(K key, boolean forward); void deleteEntry(RedBlackEntry<K, V> p);  }### Answer:
@Test public void testDepth() { tree = new RedBlackTree<Integer, String>(); tree.put(1, "one"); tree.put(2, "two"); tree.put(3, "three"); tree.put(4, "four"); tree.put(5, "five"); tree.put(6, "six"); tree.put(7, "seven"); tree.put(8, "eight"); tree.put(9, "nine"); tree.put(10, "ten"); assertEquals(4, getTreeDepth(tree)); tree = new RedBlackTree<Integer, String>(); tree.put(10, "ten"); tree.put(9, "nine"); tree.put(8, "eight"); tree.put(7, "seven"); tree.put(6, "six"); tree.put(5, "five"); tree.put(4, "four"); tree.put(3, "three"); tree.put(2, "two"); tree.put(1, "one"); assertEquals(4, getTreeDepth(tree)); }