### Question:
LinkedHashTreeMap extends AbstractMap<K, V> implements Serializable { private void doubleCapacity() { table = doubleCapacity(table); threshold = (table.length / 2) + (table.length / 4); } LinkedHashTreeMap(); @SuppressWarnings({ "unchecked", "rawtypes" // Unsafe! if comparator is null, this assumes K is comparable. })  LinkedHashTreeMap(Comparator<? super K> comparator); @Override int size(); @Override V get(Object key); @Override boolean containsKey(Object key); @Override V put(K key, V value); @Override void clear(); @Override V remove(Object key); @Override Set<Entry<K, V>> entrySet(); @Override Set<K> keySet();  }### Answer:
@Test public void doubleCapacity() { @SuppressWarnings("unchecked") Node<String, String>[] oldTable = new Node[1]; oldTable[0] = node(node(node("a"), "b", node("c")), "d", node(node("e"), "f", node("g"))); Node<String, String>[] newTable = LinkedHashTreeMap.doubleCapacity(oldTable); assertTree("(b d f)", newTable[0]); assertTree("(a c (. e g))", newTable[1]); }
@Test public void doubleCapacityAllNodesOnLeft() { @SuppressWarnings("unchecked") Node<String, String>[] oldTable = new Node[1]; oldTable[0] = node(node("b"), "d", node("f")); Node<String, String>[] newTable = LinkedHashTreeMap.doubleCapacity(oldTable); assertTree("(b d f)", newTable[0]); assertThat(newTable[1]).isNull(); for (Node<?, ?> node : newTable) { if (node != null) { assertConsistent(node); } } }