--- jsr166/src/test/tck/ConcurrentSkipListMapTest.java 2021/01/26 13:33:05 1.43 +++ jsr166/src/test/tck/ConcurrentSkipListMapTest.java 2021/01/27 01:57:24 1.44 @@ -42,7 +42,7 @@ public class ConcurrentSkipListMapTest e * Returns a new map from Items 1-5 to Strings "A"-"E". */ private static ConcurrentSkipListMap map5() { - ConcurrentSkipListMap map = new ConcurrentSkipListMap(); + ConcurrentSkipListMap map = new ConcurrentSkipListMap<>(); assertTrue(map.isEmpty()); map.put(one, "A"); map.put(five, "E"); @@ -68,7 +68,7 @@ public class ConcurrentSkipListMapTest e */ public void testConstructFromSorted() { ConcurrentSkipListMap map = map5(); - ConcurrentSkipListMap map2 = new ConcurrentSkipListMap(map); + ConcurrentSkipListMap map2 = new ConcurrentSkipListMap<>(map); mustEqual(map, map2); } @@ -110,7 +110,7 @@ public class ConcurrentSkipListMapTest e public void testGet() { ConcurrentSkipListMap map = map5(); mustEqual("A", map.get(one)); - ConcurrentSkipListMap empty = new ConcurrentSkipListMap(); + ConcurrentSkipListMap empty = new ConcurrentSkipListMap<>(); assertNull(empty.get(one)); } @@ -118,7 +118,7 @@ public class ConcurrentSkipListMapTest e * isEmpty is true of empty map and false for non-empty */ public void testIsEmpty() { - ConcurrentSkipListMap empty = new ConcurrentSkipListMap(); + ConcurrentSkipListMap empty = new ConcurrentSkipListMap<>(); ConcurrentSkipListMap map = map5(); assertTrue(empty.isEmpty()); assertFalse(map.isEmpty()); @@ -263,7 +263,7 @@ public class ConcurrentSkipListMapTest e ConcurrentSkipListMap map = map5(); Collection v = map.values(); String[] ar = v.toArray(new String[0]); - ArrayList s = new ArrayList(Arrays.asList(ar)); + ArrayList s = new ArrayList<>(Arrays.asList(ar)); mustEqual(5, ar.length); assertTrue(s.contains("A")); assertTrue(s.contains("B")); @@ -356,7 +356,7 @@ public class ConcurrentSkipListMapTest e * putAll adds all key-value pairs from the given map */ public void testPutAll() { - ConcurrentSkipListMap p = new ConcurrentSkipListMap(); + ConcurrentSkipListMap p = new ConcurrentSkipListMap<>(); ConcurrentSkipListMap map = map5(); p.putAll(map); mustEqual(5, p.size()); @@ -682,7 +682,7 @@ public class ConcurrentSkipListMapTest e */ public void testSize() { ConcurrentSkipListMap map = map5(); - ConcurrentSkipListMap empty = new ConcurrentSkipListMap(); + ConcurrentSkipListMap empty = new ConcurrentSkipListMap<>(); mustEqual(0, empty.size()); mustEqual(5, map.size()); } @@ -726,7 +726,7 @@ public class ConcurrentSkipListMapTest e * containsValue(null) throws NPE */ public void testContainsValue_NullPointerException() { - ConcurrentSkipListMap c = new ConcurrentSkipListMap(); + ConcurrentSkipListMap c = new ConcurrentSkipListMap<>(); try { c.containsValue(null); shouldThrow(); @@ -781,7 +781,7 @@ public class ConcurrentSkipListMapTest e * remove(null) throws NPE */ public void testRemove1_NullPointerException() { - ConcurrentSkipListMap c = new ConcurrentSkipListMap(); + ConcurrentSkipListMap c = new ConcurrentSkipListMap<>(); c.put(zero, "A"); try { c.remove(null); @@ -793,7 +793,7 @@ public class ConcurrentSkipListMapTest e * remove(null, x) throws NPE */ public void testRemove2_NullPointerException() { - ConcurrentSkipListMap c = new ConcurrentSkipListMap(); + ConcurrentSkipListMap c = new ConcurrentSkipListMap<>(); c.put(zero, "asdads"); try { c.remove(null, "whatever"); @@ -805,7 +805,7 @@ public class ConcurrentSkipListMapTest e * remove(x, null) returns false */ public void testRemove3() { - ConcurrentSkipListMap c = new ConcurrentSkipListMap(); + ConcurrentSkipListMap c = new ConcurrentSkipListMap<>(); c.put(zero, "asdads"); assertFalse(c.remove("sadsdf", null)); }