Code example for WeakHashMap

Methods: isEmpty, put, remove

0
     * @tests java.util.WeakHashMap#containsKey(java.lang.Object) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "containsKey", 
        args = {java.lang.Object.class}
    ) 
    public void test_containsKeyLjava_lang_Object() { 
        // Test for method boolean java.util.WeakHashMap.containsKey() 
        whm = new WeakHashMap();
        for (int i = 0; i < 100; i++)
            whm.put(keyArray[i], valueArray[i]);
        for (int i = 0; i < 100; i++)
            assertTrue("Should contain referenced key", whm
                    .containsKey(keyArray[i]));
        keyArray[25] = null;
        keyArray[50] = null;
    } 
 
    /**