ConcurrentMapperHashMap extends AbstractMap<K, V> implements ConcurrentMap<K, V>, Serializable { @Override public Set<K> keySet() { if (keySet == null) { keySet = new UnwrapKeySet(); } return keySet; } 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 testKeySet() { Set<Key> keySet = _concurrentMap.keySet(); Assert.assertSame(keySet, _concurrentMap.keySet()); Assert.assertTrue(keySet.toString(), keySet.isEmpty()); Assert.assertFalse(keySet.toString(), keySet.contains(_testKey)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY); Assert.assertFalse(keySet.remove(_testKey)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY); Assert.assertNull(_concurrentMap.put(_testKey, _testValue1)); _assertEventQueue(Event.MAP_KEY, Event.MAP_VALUE); String keySetString = keySet.toString(); _assertEventQueue(Event.UNMAP_KEY_FOR_QUERY); Assert.assertEquals(keySetString, 1, keySet.size()); Assert.assertTrue(keySetString, keySet.contains(_testKey)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY); Assert.assertTrue(keySet.remove(_testKey)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY, Event.UNMAP_VALUE); Assert.assertNull(_concurrentMap.put(_testKey, _testValue1)); _assertEventQueue(Event.MAP_KEY, Event.MAP_VALUE); keySetString = keySet.toString(); _assertEventQueue(Event.UNMAP_KEY_FOR_QUERY); Assert.assertEquals(keySetString, 1, keySet.size()); Assert.assertEquals(Collections.singleton(_testKey), keySet); _assertEventQueue(Event.UNMAP_KEY_FOR_QUERY); Iterator<Key> iterator = keySet.iterator(); Assert.assertTrue(iterator.hasNext()); Key key = iterator.next(); _assertEventQueue(Event.UNMAP_KEY_FOR_QUERY); keySetString = keySet.toString(); _assertEventQueue(Event.UNMAP_KEY_FOR_QUERY); Assert.assertEquals(_testKey, key); Assert.assertFalse(iterator.hasNext()); Assert.assertTrue(keySetString, keySet.contains(key)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY); iterator.remove(); Assert.assertTrue(keySet.toString(), keySet.isEmpty()); Assert.assertFalse(keySet.toString(), keySet.contains(key)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY); Assert.assertNull(_concurrentMap.put(_testKey, _testValue1)); _assertEventQueue(Event.MAP_KEY, Event.MAP_VALUE); Assert.assertEquals(keySet.toString(), 1, keySet.size()); keySet.clear(); Assert.assertTrue(_concurrentMap.isEmpty()); }