334 |
|
int[] sum = new int[1]; |
335 |
|
for (int i = 0; i < iterations; i++) { |
336 |
|
sum[0] = 0; |
337 |
< |
x.removeIf(n -> { sum[0] += n; return false; }); |
337 |
> |
if (x.removeIf(n -> { sum[0] += n; return false; })) |
338 |
> |
throw new AssertionError(); |
339 |
|
check.sum(sum[0]);}}}, |
340 |
|
new Job(klazz + " .contains") { |
341 |
|
public void work() throws Throwable { |
345 |
|
sum[0] += (int) z; return false; }}; |
346 |
|
for (int i = 0; i < iterations; i++) { |
347 |
|
sum[0] = 0; |
348 |
< |
x.contains(y); |
348 |
> |
if (x.contains(y)) throw new AssertionError(); |
349 |
> |
check.sum(sum[0]);}}}, |
350 |
> |
new Job(klazz + " .remove(Object)") { |
351 |
> |
public void work() throws Throwable { |
352 |
> |
int[] sum = new int[1]; |
353 |
> |
Object y = new Object() { |
354 |
> |
public boolean equals(Object z) { |
355 |
> |
sum[0] += (int) z; return false; }}; |
356 |
> |
for (int i = 0; i < iterations; i++) { |
357 |
> |
sum[0] = 0; |
358 |
> |
if (x.remove(y)) throw new AssertionError(); |
359 |
|
check.sum(sum[0]);}}}, |
360 |
|
new Job(klazz + " .forEach") { |
361 |
|
public void work() throws Throwable { |