code: public final void finalizeStream(Stream stream) {
      FinalizeStreamRequest request = FinalizeStreamRequest.newBuilder().setStream(stream).build();
      finalizeStream(request);
    }
docs: Triggers the graceful termination of a single stream in a ReadSession. This API can be used to
  dynamically adjust the parallelism of a batch processing task downwards without losing data.
  
  <p>This API does not delete the stream -- it remains visible in the ReadSession, and any data
  processed by the stream is not released to other streams. However, no additional data will be
  assigned to the stream once this call completes. Callers must continue reading data on the
  stream until the end of the stream is reached so that data which has already been assigned to
  the stream will be processed.
  
  <p>This method will return an error if there are no other live streams in the Session, or if
  SplitReadStream() has been called on the given Stream.
  
  <p>Sample code:
  
  <pre><code>
  try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
  Stream stream = Stream.newBuilder().build();
  bigQueryStorageClient.finalizeStream(stream);
  }
  </code></pre>
  
  @param stream Stream to finalize.
  @throws com.google.api.gax.rpc.ApiException if the remote call fails