@Override public boolean remove(@NotNull Object key, Object value) { long h = hasher.hash(key); int segment = hasher.getSegment(); Segment<K, V> segment2 = segments[segment]; //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (segment2) { V value2 = get(key); if (value2 != null && value.equals(value2)) { segment2.remove(h, (K) key); return true; } return false; } }