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

Comparing jsr166/src/test/jtreg/util/Collections/EmptyNavigableSet.java (file contents):
Revision 1.8 by jsr166, Sun Jan 7 23:26:04 2018 UTC vs.
Revision 1.9 by jsr166, Sun Jan 7 23:46:17 2018 UTC

# Line 130 | Line 130 | public class EmptyNavigableSet {
130       */
131      @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class)
132      public void testContainsRequiresComparable(String description, NavigableSet<?> navigableSet) {
133 <        assertThrowsCCE(() -> {
134 <            navigableSet.contains(new Object());
135 <        },
133 >        assertThrowsCCE(
134 >            () -> navigableSet.contains(new Object()),
135              description + ": Compareable should be required");
136      }
137  
# Line 273 | Line 272 | public class EmptyNavigableSet {
272          Object last = (BigInteger.ZERO == first) ? BigInteger.TEN : BigInteger.ZERO;
273  
274              assertThrowsIAE(
275 <                () -> {
277 <                    navigableSet.subSet(last, true, first, false);
278 <                },
275 >                () -> navigableSet.subSet(last, true, first, false),
276                  description
277                  + ": Must throw IllegalArgumentException when fromElement is not less than toElement.");
278  
# Line 295 | Line 292 | public class EmptyNavigableSet {
292          // slightly smaller
293          NavigableSet ns = subSet.subSet(first, false, last, false);
294          // slight expansion
295 <        assertThrowsIAE(() -> {
296 <            ns.subSet(first, true, last, true);
300 <        },
295 >        assertThrowsIAE(
296 >            () -> ns.subSet(first, true, last, true),
297              description + ": Expansion should not be allowed");
298  
299          // much smaller
# Line 315 | Line 311 | public class EmptyNavigableSet {
311          NavigableSet ns = subSet.headSet(BigInteger.ONE, false);
312  
313          // slight expansion
314 <        assertThrowsIAE(() -> {
315 <            ns.headSet(BigInteger.ONE, true);
320 <        },
314 >        assertThrowsIAE(
315 >            () -> ns.headSet(BigInteger.ONE, true),
316              description + ": Expansion should not be allowed");
317  
318          // much smaller
# Line 335 | Line 330 | public class EmptyNavigableSet {
330          NavigableSet ns = subSet.tailSet(BigInteger.ONE, false);
331  
332          // slight expansion
333 <        assertThrowsIAE(() -> {
334 <            ns.tailSet(BigInteger.ONE, true);
340 <        },
333 >        assertThrowsIAE(
334 >            () -> ns.tailSet(BigInteger.ONE, true),
335              description + ": Expansion should not be allowed");
336  
337          // much smaller
# Line 349 | Line 343 | public class EmptyNavigableSet {
343       */
344      @Test(dataProvider = "NavigableSet<?>", dataProviderClass = EmptyNavigableSet.class)
345      public void testTailSet(String description, NavigableSet navigableSet) {
346 <        assertThrowsNPE(() -> {
347 <            navigableSet.tailSet(null);
354 <        },
346 >        assertThrowsNPE(
347 >            () -> navigableSet.tailSet(null),
348              description + ": Must throw NullPointerException for null element");
349  
350 <        assertThrowsCCE(() -> {
351 <            navigableSet.tailSet(new Object());
352 <        }, description);
350 >        assertThrowsCCE(
351 >            () -> navigableSet.tailSet(new Object()),
352 >            description);
353  
354          NavigableSet ss = navigableSet.tailSet("1", true);
355  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines