@Test public void testRandomValuesWithObjects() { ConcurrentHashMap<Object, KeyHolder<Object>> map = new ConcurrentHashMap<Object, KeyHolder<Object>>(); for(int i = 0; i < ENTRIES; i++) { final Object o = new Object(); map.put(o, new KeyHolder<Object>(o)); } assertThings(map); }
@SuppressWarnings("unchecked") public V put(K key, V value) { if (key == null || value == null) throw new NullPointerException(); return (V)internalPut(key, value); }
ConcurrentHashMap implements ConcurrentMap<K, V>, Serializable { @SuppressWarnings("unchecked") public V put(K key, V value) { if (key == null || value == null) throw new NullPointerException(); return (V)internalPut(key, value); } }
ConcurrentHashMap implements ConcurrentMap<K, V>, Serializable { @SuppressWarnings("unchecked") public V put(K key, V value) { if (key == null || value == null) throw new NullPointerException(); return (V)internalPut(key, value); } ConcurrentHashMap();  ConcurrentHashMap(int initialCapacity);  ConcurrentHashMap(Map<? extends K, ? extends V> m);  ConcurrentHashMap(int initialCapacity, float loadFactor);  ConcurrentHashMap(int initialCapacity,
                             float loadFactor, int concurrencyLevel); }
ConcurrentHashMap implements ConcurrentMap<K, V>, Serializable { @SuppressWarnings("unchecked") public V put(K key, V value) { if (key == null || value == null) throw new NullPointerException(); return (V)internalPut(key, value); } ConcurrentHashMap();  ConcurrentHashMap(int initialCapacity);  ConcurrentHashMap(Map<? extends K, ? extends V> m);  ConcurrentHashMap(int initialCapacity, float loadFactor);  ConcurrentHashMap(int initialCapacity,
                             float loadFactor, int concurrencyLevel); static KeySetView<K,Boolean> newKeySet(); static KeySetView<K,Boolean> newKeySet(int initialCapacity); boolean isEmpty(); int size(); long mappingCount(); @SuppressWarnings("unchecked") V get(Object key); @SuppressWarnings("unchecked") V getValueOrDefault(Object key, V defaultValue); boolean containsKey(Object key); boolean containsValue(Object value); boolean contains(Object value); @SuppressWarnings("unchecked") V put(K key, V value); @SuppressWarnings("unchecked") V putIfAbsent(K key, V value); void putAll(Map<? extends K, ? extends V> m); @SuppressWarnings("unchecked") V computeIfAbsent(K key, Fun<? super K, ? extends V> mappingFunction); @SuppressWarnings("unchecked") V computeIfPresent(K key, BiFun<? super K, ? super V, ? extends V> remappingFunction); @SuppressWarnings("unchecked") V compute(K key, BiFun<? super K, ? super V, ? extends V> remappingFunction); @SuppressWarnings("unchecked") V merge(K key, V value, BiFun<? super V, ? super V, ? extends V> remappingFunction); @SuppressWarnings("unchecked") V remove(Object key); boolean remove(Object key, Object value); boolean replace(K key, V oldValue, V newValue); @SuppressWarnings("unchecked") V replace(K key, V value); void clear(); KeySetView<K,V> keySet(); KeySetView<K,V> keySet(V mappedValue); ValuesView<K,V> values(); Set<Map.Entry<K,V>> entrySet(); Enumeration<K> keys(); Enumeration<V> elements(); Spliterator<K> keySpliterator(); Spliterator<V> valueSpliterator(); Spliterator<Map.Entry<K,V>> entrySpliterator(); int hashCode(); String toString(); boolean equals(Object o); void forEach(BiAction<K,V> action); void forEach(BiFun<? super K, ? super V, ? extends U> transformer,
                            Action<U> action); U search(BiFun<? super K, ? super V, ? extends U> searchFunction); U reduce(BiFun<? super K, ? super V, ? extends U> transformer,
                        BiFun<? super U, ? super U, ? extends U> reducer); double reduceToDouble(ObjectByObjectToDouble<? super K, ? super V> transformer,
                                 double basis,
                                 DoubleByDoubleToDouble reducer); long reduceToLong(ObjectByObjectToLong<? super K, ? super V> transformer,
                             long basis,
                             LongByLongToLong reducer); int reduceToInt(ObjectByObjectToInt<? super K, ? super V> transformer,
                           int basis,
                           IntByIntToInt reducer); void forEachKey(Action<K> action); void forEachKey(Fun<? super K, ? extends U> transformer,
                               Action<U> action); U searchKeys(Fun<? super K, ? extends U> searchFunction); K reduceKeys(BiFun<? super K, ? super K, ? extends K> reducer); U reduceKeys(Fun<? super K, ? extends U> transformer,
                            BiFun<? super U, ? super U, ? extends U> reducer); double reduceKeysToDouble(ObjectToDouble<? super K> transformer,
                                     double basis,
                                     DoubleByDoubleToDouble reducer); long reduceKeysToLong(ObjectToLong<? super K> transformer,
                                 long basis,
                                 LongByLongToLong reducer); int reduceKeysToInt(ObjectToInt<? super K> transformer,
                               int basis,
                               IntByIntToInt reducer); void forEachValue(Action<V> action); void forEachValue(Fun<? super V, ? extends U> transformer,
                                 Action<U> action); U searchValues(Fun<? super V, ? extends U> searchFunction); V reduceValues(BiFun<? super V, ? super V, ? extends V> reducer); U reduceValues(Fun<? super V, ? extends U> transformer,
                              BiFun<? super U, ? super U, ? extends U> reducer); double reduceValuesToDouble(ObjectToDouble<? super V> transformer,
                                       double basis,
                                       DoubleByDoubleToDouble reducer); long reduceValuesToLong(ObjectToLong<? super V> transformer,
                                   long basis,
                                   LongByLongToLong reducer); int reduceValuesToInt(ObjectToInt<? super V> transformer,
                                 int basis,
                                 IntByIntToInt reducer); void forEachEntry(Action<Map.Entry<K,V>> action); void forEachEntry(Fun<Map.Entry<K,V>, ? extends U> transformer,
                                 Action<U> action); U searchEntries(Fun<Map.Entry<K,V>, ? extends U> searchFunction); Map.Entry<K,V> reduceEntries(BiFun<Map.Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer); U reduceEntries(Fun<Map.Entry<K,V>, ? extends U> transformer,
                               BiFun<? super U, ? super U, ? extends U> reducer); double reduceEntriesToDouble(ObjectToDouble<Map.Entry<K,V>> transformer,
                                        double basis,
                                        DoubleByDoubleToDouble reducer); long reduceEntriesToLong(ObjectToLong<Map.Entry<K,V>> transformer,
                                    long basis,
                                    LongByLongToLong reducer); int reduceEntriesToInt(ObjectToInt<Map.Entry<K,V>> transformer,
                                  int basis,
                                  IntByIntToInt reducer); }
ConcurrentHashMap implements ConcurrentMap<K, V>, Serializable { @SuppressWarnings("unchecked") public V put(K key, V value) { if (key == null || value == null) throw new NullPointerException(); return (V)internalPut(key, value); } ConcurrentHashMap();  ConcurrentHashMap(int initialCapacity);  ConcurrentHashMap(Map<? extends K, ? extends V> m);  ConcurrentHashMap(int initialCapacity, float loadFactor);  ConcurrentHashMap(int initialCapacity,
                             float loadFactor, int concurrencyLevel); static KeySetView<K,Boolean> newKeySet(); static KeySetView<K,Boolean> newKeySet(int initialCapacity); boolean isEmpty(); int size(); long mappingCount(); @SuppressWarnings("unchecked") V get(Object key); @SuppressWarnings("unchecked") V getValueOrDefault(Object key, V defaultValue); boolean containsKey(Object key); boolean containsValue(Object value); boolean contains(Object value); @SuppressWarnings("unchecked") V put(K key, V value); @SuppressWarnings("unchecked") V putIfAbsent(K key, V value); void putAll(Map<? extends K, ? extends V> m); @SuppressWarnings("unchecked") V computeIfAbsent(K key, Fun<? super K, ? extends V> mappingFunction); @SuppressWarnings("unchecked") V computeIfPresent(K key, BiFun<? super K, ? super V, ? extends V> remappingFunction); @SuppressWarnings("unchecked") V compute(K key, BiFun<? super K, ? super V, ? extends V> remappingFunction); @SuppressWarnings("unchecked") V merge(K key, V value, BiFun<? super V, ? super V, ? extends V> remappingFunction); @SuppressWarnings("unchecked") V remove(Object key); boolean remove(Object key, Object value); boolean replace(K key, V oldValue, V newValue); @SuppressWarnings("unchecked") V replace(K key, V value); void clear(); KeySetView<K,V> keySet(); KeySetView<K,V> keySet(V mappedValue); ValuesView<K,V> values(); Set<Map.Entry<K,V>> entrySet(); Enumeration<K> keys(); Enumeration<V> elements(); Spliterator<K> keySpliterator(); Spliterator<V> valueSpliterator(); Spliterator<Map.Entry<K,V>> entrySpliterator(); int hashCode(); String toString(); boolean equals(Object o); void forEach(BiAction<K,V> action); void forEach(BiFun<? super K, ? super V, ? extends U> transformer,
                            Action<U> action); U search(BiFun<? super K, ? super V, ? extends U> searchFunction); U reduce(BiFun<? super K, ? super V, ? extends U> transformer,
                        BiFun<? super U, ? super U, ? extends U> reducer); double reduceToDouble(ObjectByObjectToDouble<? super K, ? super V> transformer,
                                 double basis,
                                 DoubleByDoubleToDouble reducer); long reduceToLong(ObjectByObjectToLong<? super K, ? super V> transformer,
                             long basis,
                             LongByLongToLong reducer); int reduceToInt(ObjectByObjectToInt<? super K, ? super V> transformer,
                           int basis,
                           IntByIntToInt reducer); void forEachKey(Action<K> action); void forEachKey(Fun<? super K, ? extends U> transformer,
                               Action<U> action); U searchKeys(Fun<? super K, ? extends U> searchFunction); K reduceKeys(BiFun<? super K, ? super K, ? extends K> reducer); U reduceKeys(Fun<? super K, ? extends U> transformer,
                            BiFun<? super U, ? super U, ? extends U> reducer); double reduceKeysToDouble(ObjectToDouble<? super K> transformer,
                                     double basis,
                                     DoubleByDoubleToDouble reducer); long reduceKeysToLong(ObjectToLong<? super K> transformer,
                                 long basis,
                                 LongByLongToLong reducer); int reduceKeysToInt(ObjectToInt<? super K> transformer,
                               int basis,
                               IntByIntToInt reducer); void forEachValue(Action<V> action); void forEachValue(Fun<? super V, ? extends U> transformer,
                                 Action<U> action); U searchValues(Fun<? super V, ? extends U> searchFunction); V reduceValues(BiFun<? super V, ? super V, ? extends V> reducer); U reduceValues(Fun<? super V, ? extends U> transformer,
                              BiFun<? super U, ? super U, ? extends U> reducer); double reduceValuesToDouble(ObjectToDouble<? super V> transformer,
                                       double basis,
                                       DoubleByDoubleToDouble reducer); long reduceValuesToLong(ObjectToLong<? super V> transformer,
                                   long basis,
                                   LongByLongToLong reducer); int reduceValuesToInt(ObjectToInt<? super V> transformer,
                                 int basis,
                                 IntByIntToInt reducer); void forEachEntry(Action<Map.Entry<K,V>> action); void forEachEntry(Fun<Map.Entry<K,V>, ? extends U> transformer,
                                 Action<U> action); U searchEntries(Fun<Map.Entry<K,V>, ? extends U> searchFunction); Map.Entry<K,V> reduceEntries(BiFun<Map.Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer); U reduceEntries(Fun<Map.Entry<K,V>, ? extends U> transformer,
                               BiFun<? super U, ? super U, ? extends U> reducer); double reduceEntriesToDouble(ObjectToDouble<Map.Entry<K,V>> transformer,
                                        double basis,
                                        DoubleByDoubleToDouble reducer); long reduceEntriesToLong(ObjectToLong<Map.Entry<K,V>> transformer,
                                    long basis,
                                    LongByLongToLong reducer); int reduceEntriesToInt(ObjectToInt<Map.Entry<K,V>> transformer,
                                  int basis,
                                  IntByIntToInt reducer);  }