--- jsr166/src/test/tck/TreeMapTest.java 2021/01/26 13:33:06 1.36 +++ jsr166/src/test/tck/TreeMapTest.java 2021/01/27 01:57:25 1.37 @@ -40,7 +40,7 @@ public class TreeMapTest extends JSR166T * Returns a new map from Items 1-5 to Strings "A"-"E". */ private static TreeMap map5() { - TreeMap map = new TreeMap(); + TreeMap map = new TreeMap<>(); assertTrue(map.isEmpty()); map.put(one, "A"); map.put(five, "E"); @@ -66,7 +66,7 @@ public class TreeMapTest extends JSR166T */ public void testConstructFromSorted() { TreeMap map = map5(); - TreeMap map2 = new TreeMap(map); + TreeMap map2 = new TreeMap<>(map); mustEqual(map, map2); } @@ -108,7 +108,7 @@ public class TreeMapTest extends JSR166T public void testGet() { TreeMap map = map5(); mustEqual("A", map.get(one)); - TreeMap empty = new TreeMap(); + TreeMap empty = new TreeMap<>(); assertNull(empty.get(one)); } @@ -116,7 +116,7 @@ public class TreeMapTest extends JSR166T * isEmpty is true of empty map and false for non-empty */ public void testIsEmpty() { - TreeMap empty = new TreeMap(); + TreeMap empty = new TreeMap<>(); TreeMap map = map5(); assertTrue(empty.isEmpty()); assertFalse(map.isEmpty()); @@ -338,7 +338,7 @@ public class TreeMapTest extends JSR166T * putAll adds all key-value pairs from the given map */ public void testPutAll() { - TreeMap empty = new TreeMap(); + TreeMap empty = new TreeMap<>(); TreeMap map = map5(); empty.putAll(map); mustEqual(5, empty.size()); @@ -562,7 +562,7 @@ public class TreeMapTest extends JSR166T */ public void testSize() { TreeMap map = map5(); - TreeMap empty = new TreeMap(); + TreeMap empty = new TreeMap<>(); mustEqual(0, empty.size()); mustEqual(5, map.size()); } @@ -606,7 +606,7 @@ public class TreeMapTest extends JSR166T * remove(null) throws NPE for nonempty map */ public void testRemove1_NullPointerException() { - TreeMap c = new TreeMap(); + TreeMap c = new TreeMap<>(); c.put(one, "asdads"); try { c.remove(null);