ConcurrentMapperHashMap extends AbstractMap<K, V> implements ConcurrentMap<K, V>, Serializable { @Override public V computeIfPresent( K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { if (key == null) { throw new NullPointerException("Key is null"); } if (remappingFunction == null) { throw new NullPointerException("Remapping function is null"); } IK innerKey = mapKeyForQuery(key); Object[] valueHolder = new Object[1]; innerConcurrentMap.computeIfPresent( innerKey, (iKey, iValue) -> { V value = remappingFunction.apply(key, unmapValue(iValue)); if (value == null) { return null; } valueHolder[0] = value; return mapValue(key, value); }); return (V)valueHolder[0]; } 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 testComputeIfPresent() { try { _concurrentMap.computeIfPresent(null, null); Assert.fail("Should throw NullPointerException"); } catch (NullPointerException nullPointerException) { Assert.assertEquals( "Key is null", nullPointerException.getMessage()); } try { _concurrentMap.computeIfPresent(_testKey, null); Assert.fail("Should throw NullPointerException"); } catch (NullPointerException nullPointerException) { Assert.assertEquals( "Remapping function is null", nullPointerException.getMessage()); } Assert.assertNull( _concurrentMap.computeIfPresent(_testKey, (key, value) -> null)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY); Assert.assertNull( _concurrentMap.computeIfPresent( _testKey, (key, value) -> _testValue1)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY); Assert.assertNull(_concurrentMap.put(_testKey, _testValue1)); _assertEventQueue(Event.MAP_KEY, Event.MAP_VALUE); Assert.assertSame( _testValue2, _concurrentMap.computeIfPresent( _testKey, (key, value) -> _testValue2)); _assertEventQueue( Event.MAP_KEY_FOR_QUERY, Event.UNMAP_VALUE, Event.MAP_VALUE); Assert.assertNull( _concurrentMap.computeIfPresent(_testKey, (key, value) -> null)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY, Event.UNMAP_VALUE); Assert.assertNull(_concurrentMap.get(_testKey)); _assertEventQueue(Event.MAP_KEY_FOR_QUERY); }