< prev index next >
test/jdk/java/util/concurrent/tck/Collection8Test.java
Print this page
8234131: Miscellaneous changes imported from jsr166 CVS 2021-01
Reviewed-by: martin
*** 438,448 ****
for (int i = rnd.nextInt(n + 1); --i >= 0; ) {
assertTrue(s.tryAdvance(e -> {}));
if (rnd.nextBoolean()) assertTrue(it.hasNext());
it.next();
}
- Consumer alwaysThrows = e -> { throw new AssertionError(); };
// TODO: many more removal methods
if (rnd.nextBoolean()) {
for (Iterator z = c.iterator(); z.hasNext(); ) {
Object e = z.next();
if (rnd.nextBoolean()) {
--- 438,447 ----
*** 659,669 ****
/**
* stream().forEach returns elements in the collection
*/
public void testStreamForEach() throws Throwable {
final Collection c = impl.emptyCollection();
- final AtomicLong count = new AtomicLong(0L);
final Object x = impl.makeElement(1);
final Object y = impl.makeElement(2);
final ArrayList found = new ArrayList();
Consumer<Object> spy = o -> found.add(o);
c.stream().forEach(spy);
--- 658,667 ----
*** 717,727 ****
/**
* collection.forEach returns elements in the collection
*/
public void testForEach() throws Throwable {
final Collection c = impl.emptyCollection();
- final AtomicLong count = new AtomicLong(0L);
final Object x = impl.makeElement(1);
final Object y = impl.makeElement(2);
final ArrayList found = new ArrayList();
Consumer<Object> spy = o -> found.add(o);
c.forEach(spy);
--- 715,724 ----
< prev index next >