### Question:
HashMap extends Map<K, V> { @Override public Collection<V> values() { if (valuesCollection == null) valuesCollection = new ValuesCollection<K, V>(this); return valuesCollection; } 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 testValues() { Collection<Object> c = hm.values(); assertTrue("Returned collection of incorrect size()", c.size() == hm.size()); for (int i = 0; i < objArray.length; i++) { assertTrue("Returned collection does not contain all keys", c.contains(objArray[i])); } HashMap<Object, Object> myHashMap = new HashMap<Object, Object>(); for (int i = 0; i < 100; i++) { myHashMap.put(objArray2[i], objArray[i]); } Collection<Object> values = myHashMap.values(); values.remove(0); assertTrue("Removing from the values collection should remove from the original map", !myHashMap.containsValue(0)); }