Code example for IdentityHashMap

Methods: getput

0
        // java.util.IdentityHashMap.put(java.lang.Object, java.lang.Object) 
        hm.put("KEY", "VALUE");
        assertEquals("Failed to install key/value pair",
                "VALUE", hm.get("KEY"));
 
        IdentityHashMap m = new IdentityHashMap();
        Short s0 = new Short((short) 0);
        m.put(s0, "short");
        m.put(null, "test");
        Integer i0 = new Integer(0);
        m.put(i0, "int");
        assertEquals("Failed adding to bucket containing null",
                "short", m.get(s0));
        assertEquals("Failed adding to bucket containing null2", "int", m.get(i0)
                ); 
    } 
 
    /** 
     * java.util.IdentityHashMap#putAll(java.util.Map) 
     */