public default boolean remove (Object key, Object value)

Removes the entry for the specified key only if it is currently mapped to the specified value.

Parameters:
key    key with which the specified value is associated
value    value expected to be associated with the specified key

Returns:  true if the value was removed

Exceptions:
UnsupportedOperationException    if the remove operation is not supported by this map (optional)
ClassCastException    if the key or value is of an inappropriate type for this map (optional)
NullPointerException    if the specified key or value is null, and this map does not permit null keys or values (optional)

Since:  1.8

@implSpec The default implementation is equivalent to, for this map:

 
 if (map.containsKey(key) && Objects.equals(map.get(key), value)) {
     map.remove(key);
     return true;
  else
     return false;
 }

The default implementation makes no guarantees about synchronization or atomicity properties of this method. Any implementation providing atomicity guarantees must override this method and document its concurrency properties.