Code example for TreeMap

Methods: comparator, firstKey, lastKey, put

0
    TreeMap tm;
 
    Object objArray[] = new Object[1000];
 
    /** 
     * @tests java.util.TreeMap#TreeMap() 
     */ 
    public void test_Constructor() { 
        // Test for method java.util.TreeMap() 
        new Support_MapTest2(new TreeMap()).runTest();
 
        assertTrue("New treeMap non-empty", new TreeMap().isEmpty());
    } 
 
    /** 
     * @tests java.util.TreeMap#TreeMap(java.util.Comparator) 
     */ 
    public void test_ConstructorLjava_util_Comparator() { 
        // Test for method java.util.TreeMap(java.util.Comparator) 
        Comparator comp = new ReversedComparator();
        TreeMap reversedTreeMap = new TreeMap(comp);