List of usage examples for java.util.concurrent ArrayBlockingQueue addAll
boolean addAll(Collection<? extends E> c);
From source file:de.vandermeer.skb.interfaces.strategies.collections.queue.ArrayBlockingQueueStrategy.java
/** * Returns a new collection for the given collection. * @param capacity the queue's capacity/*from w w w .j av a 2s .co m*/ * @param collection input collection * @return new collection */ default ArrayBlockingQueue<T> get(int capacity, Collection<T> collection) { ArrayBlockingQueue<T> ret = new ArrayBlockingQueue<T>(capacity); if (collection != null) { ret.addAll(collection); } return ret; }