ConcurrentMapperHashMap extends AbstractMap<K, V> implements ConcurrentMap<K, V>, Serializable { @Override public Set<Entry<K, V>> entrySet() { if (entrySet == null) { entrySet = new UnwrapEntrySet(); } return entrySet; } protected  ConcurrentMapperHashMap(
		ConcurrentMap<IK, IV> innerConcurrentMap); @Override void clear(); @Override V compute(
		K key,
		BiFunction<? super K, ? super V, ? extends V> remappingFunction); @Override V computeIfAbsent(
		K key, Function<? super K, ? extends V> mappingFunction); @Override V computeIfPresent(
		K key,
		BiFunction<? super K, ? super V, ? extends V> remappingFunction); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override Set<Entry<K, V>> entrySet(); @Override V get(Object 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 putIfAbsent(K key, V value); @Override V remove(Object key); @Override boolean remove(Object key, Object value); @Override V replace(K key, V value); @Override boolean replace(K key, V oldValue, V newValue); @Override int size(); @Override Collection<V> values();  }
@Test public void testEntrySet() { Set<Map.Entry<Key, Value>> entrySet = _concurrentMap.entrySet(); Assert.assertSame(entrySet, _concurrentMap.entrySet()); Assert.assertTrue(entrySet.toString(), entrySet.isEmpty()); Assert.assertFalse( entrySet.toString(), entrySet.contains(new Object())); Assert.assertFalse(entrySet.remove(new Object())); Assert.assertNull(_concurrentMap.put(_testKey, _testValue1)); _assertEventQueue(Event.MAP_KEY, Event.MAP_VALUE); Assert.assertEquals(entrySet.toString(), 1, entrySet.size()); Assert.assertTrue( entrySet.toString(), entrySet.contains( new AbstractMap.SimpleEntry<Key, Value>( _testKey, _testValue1))); _assertEventQueue(Event.MAP_KEY_FOR_QUERY, Event.UNMAP_VALUE_FOR_QUERY); Assert.assertFalse( entrySet.toString(), entrySet.contains( new AbstractMap.SimpleEntry<Key, Value>( _testKey, new Value("")))); _assertEventQueue(Event.MAP_KEY_FOR_QUERY, Event.UNMAP_VALUE_FOR_QUERY); Assert.assertFalse( entrySet.remove( new AbstractMap.SimpleEntry<Key, Value>( _testKey, new Value("")))); _assertEventQueue(Event.MAP_KEY_FOR_QUERY, Event.MAP_VALUE_FOR_QUERY); Assert.assertTrue( entrySet.remove( new AbstractMap.SimpleEntry<Key, Value>( _testKey, _testValue1))); _assertEventQueue( Event.MAP_KEY_FOR_QUERY, Event.MAP_VALUE_FOR_QUERY, Event.UNMAP_VALUE); Assert.assertNull(_concurrentMap.put(_testKey, _testValue1)); _assertEventQueue(Event.MAP_KEY, Event.MAP_VALUE); Iterator<Map.Entry<Key, Value>> iterator = entrySet.iterator(); Assert.assertTrue(iterator.hasNext()); Map.Entry<Key, Value> entry = iterator.next(); Assert.assertEquals(entry, entry); Assert.assertNotEquals(entry, new Object()); Assert.assertNotEquals( entry, new AbstractMap.SimpleEntry<Key, Value>( new Key("someKey"), _testValue1)); _assertEventQueue(Event.UNMAP_KEY_FOR_QUERY); Assert.assertNotEquals( entry, new AbstractMap.SimpleEntry<Key, Value>(_testKey, new Value(""))); _assertEventQueue( Event.UNMAP_KEY_FOR_QUERY, Event.UNMAP_VALUE_FOR_QUERY); Assert.assertEquals( entry, new AbstractMap.SimpleEntry<Key, Value>(_testKey, _testValue1)); _assertEventQueue( Event.UNMAP_KEY_FOR_QUERY, Event.UNMAP_VALUE_FOR_QUERY); Assert.assertEquals( _testKey.hashCode() ^ _testValue1.hashCode(), entry.hashCode()); Assert.assertFalse(iterator.hasNext()); Assert.assertSame(_testKey, entry.getKey()); _assertEventQueue(Event.UNMAP_KEY_FOR_QUERY); Assert.assertSame(_testValue1, entry.getValue()); _assertEventQueue(Event.UNMAP_VALUE_FOR_QUERY); Assert.assertTrue(entrySet.toString(), entrySet.contains(entry)); _assertEventQueue( Event.UNMAP_KEY_FOR_QUERY, Event.MAP_KEY_FOR_QUERY, Event.UNMAP_VALUE_FOR_QUERY, Event.UNMAP_VALUE_FOR_QUERY); entry.setValue(_testValue2); _assertEventQueue( Event.UNMAP_KEY_FOR_QUERY, Event.MAP_VALUE_FOR_QUERY, Event.UNMAP_VALUE_FOR_QUERY, Event.MAP_KEY, Event.MAP_VALUE, Event.UNMAP_KEY, Event.UNMAP_VALUE); Assert.assertSame(_testValue2, _concurrentMap.get(_testKey)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY, Event.UNMAP_VALUE_FOR_QUERY); iterator.remove(); Assert.assertTrue(entrySet.toString(), entrySet.isEmpty()); Assert.assertFalse(entrySet.toString(), entrySet.contains(entry)); _assertEventQueue(Event.UNMAP_KEY_FOR_QUERY, Event.MAP_KEY_FOR_QUERY); Assert.assertNull(_concurrentMap.put(_testKey, _testValue1)); _assertEventQueue(Event.MAP_KEY, Event.MAP_VALUE); Assert.assertEquals(entrySet.toString(), 1, entrySet.size()); entrySet.clear(); Assert.assertTrue(entrySet.toString(), entrySet.isEmpty()); }