class ClosableBlockingQueue {

	public List<E> pollBatch() {
		lock.lock();
		try {
			if (open) {
				if (elements.size() > 0) {
					ArrayList<E> result = new ArrayList<>(elements);
					elements.clear();
					return result;
				} else {
					return null;
				}
			} else {
				throw new IllegalStateException("queue is closed");
			}
		} finally {
			lock.unlock();
		}
	}

	public  ClosableBlockingQueue();
	public  ClosableBlockingQueue(int initialSize);
	public  ClosableBlockingQueue(Collection<? extends E> initialElements);

}