447 |
|
/** |
448 |
|
* Various ways of traversing a collection yield same elements |
449 |
|
*/ |
450 |
< |
public void testIteratorEquivalence() { |
450 |
> |
public void testTraversalEquivalence() { |
451 |
|
Collection c = impl.emptyCollection(); |
452 |
|
ThreadLocalRandom rnd = ThreadLocalRandom.current(); |
453 |
|
int n = rnd.nextInt(6); |
798 |
|
} |
799 |
|
} |
800 |
|
|
801 |
+ |
/** |
802 |
+ |
* Spliterator.getComparator throws IllegalStateException iff the |
803 |
+ |
* spliterator does not report SORTED. |
804 |
+ |
*/ |
805 |
+ |
public void testGetComparator_IllegalStateException() { |
806 |
+ |
Collection c = impl.emptyCollection(); |
807 |
+ |
Spliterator s = c.spliterator(); |
808 |
+ |
boolean reportsSorted = s.hasCharacteristics(Spliterator.SORTED); |
809 |
+ |
try { |
810 |
+ |
s.getComparator(); |
811 |
+ |
assertTrue(reportsSorted); |
812 |
+ |
} catch (IllegalStateException ex) { |
813 |
+ |
assertFalse(reportsSorted); |
814 |
+ |
} |
815 |
+ |
} |
816 |
+ |
|
817 |
|
// public void testCollection8DebugFail() { |
818 |
|
// fail(impl.klazz().getSimpleName()); |
819 |
|
// } |