code: public List<E> getBatchBlocking() throws InterruptedException {
  		lock.lock();
  		try {
  			while (open && elements.isEmpty()) {
  				nonEmpty.await();
  			}
  			if (open) {
  				ArrayList<E> result = new ArrayList<>(elements);
  				elements.clear();
  				return result;
  			} else {
  				throw new IllegalStateException("queue is closed");
  			}
  		} finally {
  			lock.unlock();
  		}
  	}
docs: Gets all the elements found in the list, or blocks until at least one element
  was added. If the queue is empty when this method is called, it blocks until
  at least one element is added.
  
  <p>This method always returns a list with at least one element.
  
  <p>The method throws an {@code IllegalStateException} if the queue is closed.
  Checking whether the queue is open and removing the next element is one atomic operation.
  
  @return A list with all elements in the queue, always at least one element.
  
  @throws IllegalStateException Thrown, if the queue is closed.
  @throws InterruptedException Throw, if the thread is interrupted while waiting for an
  element to be added.