### Question:
HashMap extends Map<K, V> { @Override public void putAll(Map<? extends K, ? extends V> map) { if (!map.isEmpty()) { putAllImpl(map); } } HashMap();  HashMap(int capacity);  HashMap(int capacity, float loadFactor);  HashMap(Map<K, V> map); @Override void clear(); @Override boolean containsKey(K key); @Override boolean containsValue(V value); @Override Set<MapEntry<K, V>> entrySet(); @Override V get(K key); @Override boolean isEmpty(); @Override Set<K> keySet(); @Override V put(K key, V value); @Override void putAll(Map<? extends K, ? extends V> map); @Override V remove(K key); @Override int size(); @Override Collection<V> values();  }### Answer:
@Test public void testPutAll() { HashMap<Object, Object> hm2 = new HashMap<Object, Object>(); hm2.putAll(hm); for (int i = 0; i < 1000; i++) { assertTrue("Failed to clear all elements", (Integer) hm2.get(Integers.toString(i)) == i); } HashMap<Object, Object> emptyHashMap = new HashMap<Object, Object>(); hm2 = new HashMap<Object, Object>(); hm2.putAll(emptyHashMap); assertEquals("Size should be 0", 0, hm2.size()); }