--- jsr166/src/test/tck/Collection8Test.java 2016/12/11 19:59:51 1.39 +++ jsr166/src/test/tck/Collection8Test.java 2016/12/11 22:29:45 1.40 @@ -798,6 +798,22 @@ public class Collection8Test extends JSR } } + /** + * Spliterator.getComparator throws IllegalStateException iff the + * spliterator does not report SORTED. + */ + public void testGetComparator_IllegalStateException() { + Collection c = impl.emptyCollection(); + Spliterator s = c.spliterator(); + boolean reportsSorted = s.hasCharacteristics(Spliterator.SORTED); + try { + s.getComparator(); + assertTrue(reportsSorted); + } catch (IllegalStateException ex) { + assertFalse(reportsSorted); + } + } + // public void testCollection8DebugFail() { // fail(impl.klazz().getSimpleName()); // }