docs: public void writeHeaders(List<Header> responseHeaders, boolean outFinished, boolean flushHeaders)
        throws IOException {
      assert (!Thread.holdsLock(Http2Stream.this));
      if (responseHeaders == null) {
        throw new NullPointerException("headers == null");
      }
      synchronized (this) {
        this.hasResponseHeaders = true;
        if (outFinished) {
          this.sink.finished = true;
        }
      }
  
      // Only DATA frames are subject to flow-control. Transmit the HEADER frame if the connection
      // flow-control window is fully depleted.
      if (!flushHeaders) {
        synchronized (connection) {
          flushHeaders = connection.bytesLeftInWriteWindow == 0L;
        }
      }
  
      connection.writeHeaders(id, outFinished, responseHeaders);
  
      if (flushHeaders) {
        connection.flush();
      }
    }