ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/TreeMapTest.java
(Generate patch)

Comparing jsr166/src/test/tck/TreeMapTest.java (file contents):
Revision 1.36 by dl, Tue Jan 26 13:33:06 2021 UTC vs.
Revision 1.37 by jsr166, Wed Jan 27 01:57:25 2021 UTC

# Line 40 | Line 40 | public class TreeMapTest extends JSR166T
40       * Returns a new map from Items 1-5 to Strings "A"-"E".
41       */
42      private static TreeMap<Item,String> map5() {
43 <        TreeMap<Item,String> map = new TreeMap<Item,String>();
43 >        TreeMap<Item,String> map = new TreeMap<>();
44          assertTrue(map.isEmpty());
45          map.put(one, "A");
46          map.put(five, "E");
# Line 66 | Line 66 | public class TreeMapTest extends JSR166T
66       */
67      public void testConstructFromSorted() {
68          TreeMap<Item,String> map = map5();
69 <        TreeMap<Item,String> map2 = new TreeMap<Item,String>(map);
69 >        TreeMap<Item,String> map2 = new TreeMap<>(map);
70          mustEqual(map, map2);
71      }
72  
# Line 108 | Line 108 | public class TreeMapTest extends JSR166T
108      public void testGet() {
109          TreeMap<Item,String> map = map5();
110          mustEqual("A", map.get(one));
111 <        TreeMap<Item,String> empty = new TreeMap<Item,String>();
111 >        TreeMap<Item,String> empty = new TreeMap<>();
112          assertNull(empty.get(one));
113      }
114  
# Line 116 | Line 116 | public class TreeMapTest extends JSR166T
116       * isEmpty is true of empty map and false for non-empty
117       */
118      public void testIsEmpty() {
119 <        TreeMap<Item,String> empty = new TreeMap<Item,String>();
119 >        TreeMap<Item,String> empty = new TreeMap<>();
120          TreeMap<Item,String> map = map5();
121          assertTrue(empty.isEmpty());
122          assertFalse(map.isEmpty());
# Line 338 | Line 338 | public class TreeMapTest extends JSR166T
338       * putAll adds all key-value pairs from the given map
339       */
340      public void testPutAll() {
341 <        TreeMap<Item,String> empty = new TreeMap<Item,String>();
341 >        TreeMap<Item,String> empty = new TreeMap<>();
342          TreeMap<Item,String> map = map5();
343          empty.putAll(map);
344          mustEqual(5, empty.size());
# Line 562 | Line 562 | public class TreeMapTest extends JSR166T
562       */
563      public void testSize() {
564          TreeMap<Item,String> map = map5();
565 <        TreeMap<Item,String> empty = new TreeMap<Item,String>();
565 >        TreeMap<Item,String> empty = new TreeMap<>();
566          mustEqual(0, empty.size());
567          mustEqual(5, map.size());
568      }
# Line 606 | Line 606 | public class TreeMapTest extends JSR166T
606       * remove(null) throws NPE for nonempty map
607       */
608      public void testRemove1_NullPointerException() {
609 <        TreeMap<Item,String> c = new TreeMap<Item,String>();
609 >        TreeMap<Item,String> c = new TreeMap<>();
610          c.put(one, "asdads");
611          try {
612              c.remove(null);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines