public boolean contains( Object k ) { return NonBlockingHashMapLong.this.containsKey(k); } public boolean remove ( Object k ) { return NonBlockingHashMapLong.this.remove (k) != null; }
/** Auto-boxing version of {@link #containsKey(long)}. */ public boolean containsKey( Object key ) { return (key instanceof Long) && containsKey(((Long) key).longValue()); } /** Auto-boxing version of {@link #putIfAbsent}. */
assertThat(_nbhml.putIfAbsent(2, "v2"), nullValue()); checkSizes(2); assertTrue(_nbhml.containsKey(2)); assertThat(_nbhml.put(1, "v1a"), is("v1")); assertThat(_nbhml.put(2, "v2a"), is("v2")); assertThat(_nbhml.putIfAbsent(2, "v2b"), is("v2a")); assertThat(_nbhml.remove(1), is("v1a")); assertFalse(_nbhml.containsKey(1)); checkSizes(1); assertThat(_nbhml.remove(1), nullValue()); assertTrue(_nbhml.containsKey(0)); checkSizes(1); assertThat(_nbhml.remove(0), is("v0")); assertFalse(_nbhml.containsKey(0)); checkSizes(0); assertFalse(_nbhml.containsKey(0)); assertThat(_nbhml.put(0, "v0"), nullValue()); assertEquals(_nbhml.replace(0, "v0a"), "v0"); assertEquals(_nbhml.get(0), "v0a"); assertThat(_nbhml.remove(0), is("v0a")); assertFalse(_nbhml.containsKey(0)); checkSizes(0); assertFalse(_nbhml.containsKey(1)); assertThat(_nbhml.put(1, "v1"), nullValue()); assertEquals(_nbhml.replace(1, "v1a"), "v1");
public boolean contains( Object k ) { return NonBlockingHashMapLong.this.containsKey(k); } public boolean remove ( Object k ) { return NonBlockingHashMapLong.this.remove (k) != null; }
/** Auto-boxing version of {@link #containsKey(long)}. */ public boolean containsKey( Object key ) { return (key instanceof Long) && containsKey(((Long) key).longValue()); } /** Auto-boxing version of {@link #putIfAbsent}. */