### Question:
HashMap extends Map<K, V> { @Override public Set<MapEntry<K, V>> entrySet() { return new HashMapEntrySet<K, V>(this); } 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 testEntrySet() { Set<MapEntry<Object, Object>> s = hm.entrySet(); Iterator<MapEntry<Object, Object>> i = s.iterator(); assertTrue("Returned set of incorrect size", hm.size() == s.size()); while (i.hasNext()) { MapEntry<Object, Object> m = (MapEntry<Object, Object>) i.next(); assertTrue("Returned incorrect entry set", hm.containsKey(m.getKey()) && hm.containsValue(m.getValue())); } Iterator<MapEntry<Object, Object>> iter = s.iterator(); s.remove(iter.next()); assertEquals(1000, s.size()); }