NoOpMap extends AbstractMap<K,V> { @Override public Collection<V> values() { return Collections.emptySet(); } private  NoOpMap(); @SuppressWarnings("unchecked") static Map<K,V> instance(); @Override V put(K key, V value); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override V get(Object key); @Override Set<K> keySet(); @Override Collection<V> values(); @Override Set<Entry<K,V>> entrySet(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testValues() { Map<String, String> map = NoOpMap.instance(); map.put("hello", "world"); Collection<String> values = map.values(); assertEquals(0, values.size()); }