Code example for TreeMap

Methods: clear, entrySet, put

0
        } 
 
        size = 256;
        intMap = new TreeMap<Integer,Integer>();
        for(int i=0; i<size; i++) {
            intMap.put(i,i);
        } 
        sub = intMap.tailMap(size);
        assertEquals("size should be zero",sub.size(),0);
        assertTrue("submap should be empty",sub.isEmpty());
        try{ 
            sub.firstKey();
            fail("java.util.NoSuchElementException should be thrown");
        } catch(java.util.NoSuchElementException e) {
        } 
         
        try{ 
            sub.lastKey();
            fail("java.util.NoSuchElementException should be thrown");
        } catch(java.util.NoSuchElementException e) {
        } 
 
    } 
 
    /** 
     * @tests java.util.TreeMap#values() 
     */ 
    public void test_values() { 
        // Test for method java.util.Collection java.util.TreeMap.values() 
        Collection vals = tm.values();