code: void receiveHeaders(Headers headers, boolean inFinished) {
      assert (!Thread.holdsLock(Http2Stream.this));
      boolean open;
      synchronized (this) {
        if (!hasResponseHeaders || !inFinished) {
          hasResponseHeaders = true;
          headersQueue.add(headers);
        } else {
          this.source.trailers = headers;
        }
        if (inFinished) {
          this.source.finished = true;
        }
        open = isOpen();
        notifyAll();
      }
      if (!open) {
        connection.removeStream(id);
      }
    }
docs: Accept headers from the network and store them until the client calls {@link #takeHeaders}, or
  {@link FramingSource#read} them.