Alex Miller - 2009-10-27

An example unit test that exposes the remove() bug:

public void testRemoveIsEqualityBased() {
ConcurrentMap m = new NonBlockingHashMap();

// load entry
String key = new String("key");
String value = new String("val");
assertNull(m.put(key, value));

// remove entry if value exists
String equalValue = new String("val"); // not identical but equals
assertTrue(m.remove(key, equalValue)); // NBHM returns false
}