@Test public void replace() { String x = new String("x"); String x2 = new String("x"); assertNull(mMap.put(x, "x")); assertNull(mMap.replace(x2, "x")); assertEquals(1, mMap.size()); assertEquals("x", mMap.replace(x, "y")); assertFalse(mMap.replace(x, "noreplace", "z")); assertEquals("y", mMap.get(x)); }
@Override public boolean replace(K k, V v1, V v2) { return mInternalMap.replace(new IdentityObject<>(k), v1, v2); }
ConcurrentIdentityHashMap implements ConcurrentMap<K, V> { @Override public boolean replace(K k, V v1, V v2) { return mInternalMap.replace(new IdentityObject<>(k), v1, v2); } }
ConcurrentIdentityHashMap implements ConcurrentMap<K, V> { @Override public boolean replace(K k, V v1, V v2) { return mInternalMap.replace(new IdentityObject<>(k), v1, v2); } ConcurrentIdentityHashMap();  ConcurrentIdentityHashMap(int initialCapacity);  ConcurrentIdentityHashMap(int initialCapacity, float loadFactor);  ConcurrentIdentityHashMap(int initialCapacity,
      float loadFactor, int concurrencyLevel); }
ConcurrentIdentityHashMap implements ConcurrentMap<K, V> { @Override public boolean replace(K k, V v1, V v2) { return mInternalMap.replace(new IdentityObject<>(k), v1, v2); } ConcurrentIdentityHashMap();  ConcurrentIdentityHashMap(int initialCapacity);  ConcurrentIdentityHashMap(int initialCapacity, float loadFactor);  ConcurrentIdentityHashMap(int initialCapacity,
      float loadFactor, int concurrencyLevel); @Override boolean containsKey(Object k); @Override V put(K k, V v); @Override V putIfAbsent(K k, V v); @Override boolean remove(Object k, Object v); @Override V remove(Object k); @Override boolean replace(K k, V v1, V v2); @Override V replace(K k, V v); @Override V get(Object k); @Override Collection<V> values(); @Override void clear(); @Override Set<Map.Entry<K, V>> entrySet(); @Override void putAll(Map<? extends K, ? extends V> map); @Override boolean isEmpty(); @Override int size(); @Override boolean containsValue(Object value); @Override Set<K> keySet(); }
ConcurrentIdentityHashMap implements ConcurrentMap<K, V> { @Override public boolean replace(K k, V v1, V v2) { return mInternalMap.replace(new IdentityObject<>(k), v1, v2); } ConcurrentIdentityHashMap();  ConcurrentIdentityHashMap(int initialCapacity);  ConcurrentIdentityHashMap(int initialCapacity, float loadFactor);  ConcurrentIdentityHashMap(int initialCapacity,
      float loadFactor, int concurrencyLevel); @Override boolean containsKey(Object k); @Override V put(K k, V v); @Override V putIfAbsent(K k, V v); @Override boolean remove(Object k, Object v); @Override V remove(Object k); @Override boolean replace(K k, V v1, V v2); @Override V replace(K k, V v); @Override V get(Object k); @Override Collection<V> values(); @Override void clear(); @Override Set<Map.Entry<K, V>> entrySet(); @Override void putAll(Map<? extends K, ? extends V> map); @Override boolean isEmpty(); @Override int size(); @Override boolean containsValue(Object value); @Override Set<K> keySet();  }