### Question:
SmallMap extends AbstractMap<K, V> { @Override public void clear() { firstKey = null; firstValue = null; entries = null; } SmallMap(); @Override V get(Object key); @Override V put(K key, V value); @Override void putAll(Map<? extends K, ? extends V> m); @Override V remove(Object key); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override void clear(); @Override int size(); @Override Set<Entry<K, V>> entrySet();  }### Answer:
@Test(dependsOnMethods = { "testPutAndSize" }) public void testClear() throws Exception { SmallMap<Integer, String> map = new SmallMap<>(); map.clear(); assertEquals(map.size(), 0); map.put(1, "one"); map.clear(); assertEquals(map.size(), 0); map.put(1, "one"); map.put(2, "two"); map.clear(); assertEquals(map.size(), 0); }