Code example for Enumeration

Methods: hasMoreElements

0
        h.clear();
        assertEquals("Hashtable was not cleared", 0, h.size());
        Enumeration el = h.elements();
        Enumeration keys = h.keys();
        assertTrue("Hashtable improperly cleared", !el.hasMoreElements()
                && !(keys.hasMoreElements()));
    } 
 
    /** 
     * java.util.Hashtable#clone() 
     */ 
    public void test_clone() { 
        // Test for method java.lang.Object java.util.Hashtable.clone() 
 
        Hashtable h = (Hashtable) htfull.clone();
        assertTrue("Clone different size than original", h.size() == htfull
                .size());
 
        Enumeration org = htfull.keys();
        Enumeration cpy = h.keys();