code: public boolean close() {
  		lock.lock();
  		try {
  			if (open) {
  				if (elements.isEmpty()) {
  					open = false;
  					nonEmpty.signalAll();
  					return true;
  				} else {
  					return false;
  				}
  			}
  			else {
  				// already closed
  				return true;
  			}
  		} finally {
  			lock.unlock();
  		}
  	}
docs: Tries to close the queue. Closing the queue only succeeds when no elements are
  in the queue when this method is called. Checking whether the queue is empty, and
  marking the queue as closed is one atomic operation.
  
  @return True, if the queue is closed, false if the queue remains open.