### Question:
MyHashMap { private void rehash() { Entry<K, V>[] oldTable = table; this.length *= 2; table = new Entry[this.length]; for (Entry<K, V> e : oldTable) { for (; e != null; e = e.next) { int hash = hash(e.key); int bucketIndex = bucketIndexFor(hash); table[bucketIndex] = new Entry<>(e.key, e.value, table[bucketIndex]); } } } MyHashMap();  MyHashMap(int intiCapacity);  MyHashMap(int intiCapacity, HashStrategy<K> hashStrategy); int length(); V put(K key, V value); V get(K key); void printViewable();  }### Answer:
@Test public void testRehash() { MyHashMap<String, String> map = new MyHashMap<>(8); map.put("aaa", "1"); map.put("bbb", "2"); map.put("ccc", "3"); map.put("ddd", "4"); map.put("eee", "5"); map.put("fff", "6"); assertThat(map.get("aaa"), Matchers.is("1")); assertThat(map.get("bbb"), Matchers.is("2")); assertThat(map.get("ccc"), Matchers.is("3")); assertThat(map.get("ddd"), Matchers.is("4")); assertThat(map.get("eee"), Matchers.is("5")); assertThat(map.get("fff"), Matchers.is("6")); assertThat(map.length(), Matchers.is(8)); map.printViewable(); System.out.println("==========="); map.put("zzz", "99"); assertThat(map.length(), Matchers.is(16)); map.printViewable(); }