@Test public void putIfAbsent() { String t = new String("test"); assertNull(mMap.putIfAbsent(t, "v1")); assertEquals(1, mMap.size()); assertEquals("v1", mMap.get(t)); assertFalse(mMap.containsKey("test")); assertEquals("v1", mMap.putIfAbsent(t, "v2")); assertEquals("v1", mMap.get(t)); }
@Override public V putIfAbsent(K k, V v) { return mInternalMap.putIfAbsent(new IdentityObject<>(k), v); }
ConcurrentIdentityHashMap implements ConcurrentMap<K, V> { @Override public V putIfAbsent(K k, V v) { return mInternalMap.putIfAbsent(new IdentityObject<>(k), v); } }
ConcurrentIdentityHashMap implements ConcurrentMap<K, V> { @Override public V putIfAbsent(K k, V v) { return mInternalMap.putIfAbsent(new IdentityObject<>(k), v); } ConcurrentIdentityHashMap();  ConcurrentIdentityHashMap(int initialCapacity);  ConcurrentIdentityHashMap(int initialCapacity, float loadFactor);  ConcurrentIdentityHashMap(int initialCapacity,
      float loadFactor, int concurrencyLevel); }
ConcurrentIdentityHashMap implements ConcurrentMap<K, V> { @Override public V putIfAbsent(K k, V v) { return mInternalMap.putIfAbsent(new IdentityObject<>(k), v); } 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 V putIfAbsent(K k, V v) { return mInternalMap.putIfAbsent(new IdentityObject<>(k), v); } 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();  }