List of usage examples for java.util IdentityHashMap equals
public boolean equals(Object o)
From source file:com.google.gwt.emultest.java.util.IdentityHashMapTest.java
public void testEquals() { IdentityHashMap hashMap = new IdentityHashMap(); checkEmptyHashMapAssumptions(hashMap); hashMap.put(KEY_KEY, VALUE_VAL);//from w ww .j av a 2 s. c o m IdentityHashMap copyMap = (IdentityHashMap) hashMap.clone(); assertTrue(hashMap.equals(copyMap)); hashMap.put(VALUE_VAL, KEY_KEY); assertFalse(hashMap.equals(copyMap)); }
From source file:com.google.gwt.emultest.java.util.IdentityHashMapTest.java
/** * Test that the implementation differs from a standard map in demanding * identity./*from w w w. jav a2 s . c o m*/ */ public void testIdentityBasedEquality() { IdentityHashMap hashMap1 = new IdentityHashMap(); checkEmptyHashMapAssumptions(hashMap1); IdentityHashMap hashMap2 = new IdentityHashMap(); checkEmptyHashMapAssumptions(hashMap2); hashMap1.put(new Foo(), VALUE_1); hashMap2.put(new Foo(), VALUE_1); assertFalse(hashMap1.equals(hashMap2)); }