code: void finishStream(
        int streamId,
        @Nullable Status status,
        RpcProgress rpcProgress,
        boolean stopDelivery,
        @Nullable ErrorCode errorCode,
        @Nullable Metadata trailers) {
      synchronized (lock) {
        OkHttpClientStream stream = streams.remove(streamId);
        if (stream != null) {
          if (errorCode != null) {
            frameWriter.rstStream(streamId, ErrorCode.CANCEL);
          }
          if (status != null) {
            stream
                .transportState()
                .transportReportStatus(
                    status,
                    rpcProgress,
                    stopDelivery,
                    trailers != null ? trailers : new Metadata());
          }
          if (!startPendingStreams()) {
            stopIfNecessary();
            maybeClearInUse(stream);
          }
        }
      }
    }
docs: Called when a stream is closed, we do things like:
  <ul>
  <li>Removing the stream from the map.
  <li>Optionally reporting the status.
  <li>Starting pending streams if we can.
  <li>Stopping the transport if this is the last live stream under a go-away status.
  </ul>
  
  @param streamId the Id of the stream.
  @param status the final status of this stream, null means no need to report.
  @param stopDelivery interrupt queued messages in the deframer
  @param errorCode reset the stream with this ErrorCode if not null.
  @param trailers the trailers received if not null