Code example for IdentityHashMap

Methods: get, put

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)));
	} 
 
	/** 
	 * @tests 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());
	}