Code example for IdentityHashMap

Methods: getput

0
                hm.get("T"));
        hm.put("T", "HELLO");
        assertEquals("Get returned incorecct value for existing key", "HELLO", hm.get("T")
                ); 
 
        IdentityHashMap m = new IdentityHashMap();
        m.put(null, "test");
        assertEquals("Failed with null key", "test", m.get(null));
        assertNull("Failed with missing key matching null hash", m
                .get(new Integer(0)));
    } 
 
    /** 
     * java.util.IdentityHashMap#isEmpty() 
     */ 
    public void test_isEmpty() { 
        // Test for method boolean java.util.IdentityHashMap.isEmpty() 
        assertTrue("Returned false for new map", new IdentityHashMap()
                .isEmpty());
        assertTrue("Returned true for non-empty", !hm.isEmpty());
Contextual code suggestions in your IDE  Get Codota for Java