code: public static void validatePromisedStreamState(int originalStreamId, int streamId, Http2Connection conn,
                                                     HttpCarbonMessage inboundRequestMsg) throws Http2Exception {
          if (streamId == originalStreamId) { // Not a promised stream, no need to validate
              return;
          }
          if (!isValidStreamId(streamId, conn)) {
              inboundRequestMsg.getHttpOutboundRespStatusFuture().
                      notifyHttpListener(new ServerConnectorException(PROMISED_STREAM_REJECTED_ERROR));
              throw new Http2Exception(Http2Error.REFUSED_STREAM, PROMISED_STREAM_REJECTED_ERROR);
          }
      }
docs: Validates the state of promised stream with the original stream id and given stream id.
  
  @param originalStreamId  the original id of the stream
  @param streamId          the id of the stream to be validated
  @param conn              HTTP2 connection
  @param inboundRequestMsg request message received from the client
  @throws Http2Exception throws if stream id is not valid for given connection