ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/TreeMap/NullAtEnd.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/TreeMap/NullAtEnd.java (file contents):
Revision 1.2 by jsr166, Sun Sep 5 21:32:20 2010 UTC vs.
Revision 1.3 by jsr166, Wed Jan 4 04:46:19 2017 UTC

# Line 64 | Line 64 | public class NullAtEnd {
64      }
65  
66      private static final Comparator<String> NULL_AT_END
67 <        = new Comparator<String>() {
67 >        = new Comparator<>() {
68              /**
69               * Allows for nulls.  Null is greater than anything non-null.
70               */
# Line 78 | Line 78 | public class NullAtEnd {
78  
79      public static void main(String[] args) {
80          try {
81 <            SortedMap<String,String> m1
82 <                = new TreeMap<String,String>(NULL_AT_END);
81 >            SortedMap<String,String> m1 = new TreeMap<>(NULL_AT_END);
82              check(eq(m1.put("a", "a"), null));
83              check(eq(m1.put("b", "b"), null));
84              check(eq(m1.put("c", "c"), null));
85              check(eq(m1.put(null, "d"), null));
86  
87 <            SortedMap<String,String> m2 = new TreeMap<String,String>(m1);
87 >            SortedMap<String,String> m2 = new TreeMap<>(m1);
88  
89              check(eq(m1.lastKey(), null));
90              check(eq(m1.get(m1.lastKey()), "d"));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines