54 |
|
* Returns a new set of first 5 ints. |
55 |
|
*/ |
56 |
|
private static NavigableSet<Item> set5() { |
57 |
< |
TreeSet<Item> q = new TreeSet<Item>(); |
57 |
> |
TreeSet<Item> q = new TreeSet<>(); |
58 |
|
assertTrue(q.isEmpty()); |
59 |
|
q.add(one); |
60 |
|
q.add(two); |
69 |
|
} |
70 |
|
|
71 |
|
private static NavigableSet<Item> dset5() { |
72 |
< |
TreeSet<Item> q = new TreeSet<Item>(); |
72 |
> |
TreeSet<Item> q = new TreeSet<>(); |
73 |
|
assertTrue(q.isEmpty()); |
74 |
|
q.add(minusOne); |
75 |
|
q.add(minusTwo); |
82 |
|
} |
83 |
|
|
84 |
|
private static NavigableSet<Item> set0() { |
85 |
< |
TreeSet<Item> set = new TreeSet<Item>(); |
85 |
> |
TreeSet<Item> set = new TreeSet<>(); |
86 |
|
assertTrue(set.isEmpty()); |
87 |
|
return set.tailSet(minusOne, false); |
88 |
|
} |
89 |
|
|
90 |
|
private static NavigableSet<Item> dset0() { |
91 |
< |
TreeSet<Item> set = new TreeSet<Item>(); |
91 |
> |
TreeSet<Item> set = new TreeSet<>(); |
92 |
|
assertTrue(set.isEmpty()); |
93 |
|
return set; |
94 |
|
} |
161 |
|
* Add of non-Comparable throws CCE |
162 |
|
*/ |
163 |
|
public void testAddNonComparable() { |
164 |
< |
NavigableSet<Object> q = new TreeSet<Object>(); |
164 |
> |
NavigableSet<Object> q = new TreeSet<>(); |
165 |
|
try { |
166 |
|
q.add(new Object()); |
167 |
|
q.add(new Object()); |
642 |
|
* Add of non-Comparable throws CCE |
643 |
|
*/ |
644 |
|
public void testDescendingAddNonComparable() { |
645 |
< |
NavigableSet<Object> q = new TreeSet<Object>(); |
645 |
> |
NavigableSet<Object> q = new TreeSet<>(); |
646 |
|
try { |
647 |
|
q.add(new Object()); |
648 |
|
q.add(new Object()); |
1094 |
|
*/ |
1095 |
|
public void testAddAll_idempotent() throws Exception { |
1096 |
|
Set<Item> x = populatedSet(SIZE); |
1097 |
< |
Set<Item> y = new TreeSet<Item>(x); |
1097 |
> |
Set<Item> y = new TreeSet<>(x); |
1098 |
|
y.addAll(x); |
1099 |
|
mustEqual(x, y); |
1100 |
|
mustEqual(y, x); |