272 |
|
|
273 |
|
ArrayList<Job> jobs = new ArrayList<>(); |
274 |
|
|
275 |
< |
List.of(al, ad, abq, |
276 |
< |
new LinkedList<>(al), |
277 |
< |
new PriorityQueue<>(al), |
278 |
< |
new Vector<>(al), |
279 |
< |
new ConcurrentLinkedQueue<>(al), |
280 |
< |
new ConcurrentLinkedDeque<>(al), |
281 |
< |
new LinkedBlockingQueue<>(al), |
282 |
< |
new LinkedBlockingDeque<>(al), |
283 |
< |
new LinkedTransferQueue<>(al), |
284 |
< |
new PriorityBlockingQueue<>(al)) |
285 |
< |
.stream() |
286 |
< |
.forEach(x -> { |
287 |
< |
jobs.addAll(collectionJobs(x)); |
288 |
< |
if (x instanceof Deque) |
289 |
< |
jobs.addAll(dequeJobs((Deque<Integer>)x)); |
290 |
< |
}); |
275 |
> |
List.<Collection<Integer>>of( |
276 |
> |
al, ad, abq, |
277 |
> |
new LinkedList<>(al), |
278 |
> |
new PriorityQueue<>(al), |
279 |
> |
new Vector<>(al), |
280 |
> |
new ConcurrentLinkedQueue<>(al), |
281 |
> |
new ConcurrentLinkedDeque<>(al), |
282 |
> |
new LinkedBlockingQueue<>(al), |
283 |
> |
new LinkedBlockingDeque<>(al), |
284 |
> |
new LinkedTransferQueue<>(al), |
285 |
> |
new PriorityBlockingQueue<>(al)).forEach( |
286 |
> |
x -> { |
287 |
> |
jobs.addAll(collectionJobs(x)); |
288 |
> |
if (x instanceof Deque) |
289 |
> |
jobs.addAll(dequeJobs((Deque<Integer>)x)); |
290 |
> |
}); |
291 |
|
|
292 |
|
if (reverse) Collections.reverse(jobs); |
293 |
|
if (shuffle) Collections.shuffle(jobs); |