code: public int drainToBlocking(Collection<? super T> c, int max_elements) throws InterruptedException {
          lock.lockInterruptibly(); // fail fast
          try {
              while(count == 0)
                  not_empty.await();
              return drainTo(c, max_elements);
          }
          finally {
              lock.unlock();
          }
      }
docs: Removes a number of messages and adds them to c. Contrary to {@link #drainTo(Collection,int)}, this method
  blocks until at least one message is available, or the caller thread is interrupted.
  @param c The collection to which to add the removed messages.
  @param max_elements The max number of messages to remove. The actual number of messages removed may be smaller
  if the buffer has fewer elements
  @return The number of messages removed
  @throws NullPointerException If c is null