code: public void add(T item) {
          CompletableFuture<Queue<T>> pending;
          Queue<T> result = null;
          synchronized (this.contents) {
              Exceptions.checkNotClosed(this.closed, this);
              this.contents.addLast(item);
              pending = this.pendingTake;
              this.pendingTake = null;
              if (pending != null) {
                  result = fetch(this.contents.size());
              }
          }
  
          if (pending != null) {
              pending.complete(result);
          }
      }
docs: Adds a new item to the queue.
  
  @param item The item to add.
  @throws ObjectClosedException If the Queue is closed.