Code example for IdentityHashMap

Methods: clone, remove

0
        assertNull(((IdentityHashMap) cloneHashMap).get((Object) null));
        assertEquals(cloneHashMap, hashMap.get((Object) null));
    } 
 
    public void test_clone_scenario5() throws Exception { 
        IdentityHashMap hashMap = new IdentityHashMap();
        Object cloneHashMap = hashMap.clone();
        assertNull(hashMap.remove((Object) null));
        ((IdentityHashMap) cloneHashMap).put((Object) null, cloneHashMap);
        assertNull(hashMap.remove((Object) null));
        assertEquals(cloneHashMap, ((IdentityHashMap) cloneHashMap)
                .get((Object) null));
    } 
 
    // comparator for IdentityHashMap objects 
    private static final SerializableAssert COMPARATOR = new SerializableAssert() {
        public void assertDeserialized(Serializable initial, 
                Serializable deserialized) { 
 
            IdentityHashMap init = (IdentityHashMap) initial; 
            IdentityHashMap desr = (IdentityHashMap) deserialized;