code: public static ClientInterceptor newCaptureMetadataInterceptor(
        AtomicReference<Metadata> headersCapture, AtomicReference<Metadata> trailersCapture) {
      return new MetadataCapturingClientInterceptor(headersCapture, trailersCapture);
    }
docs: Captures the last received metadata on a channel. Useful for testing.
  
  @param headersCapture to record the last received headers
  @param trailersCapture to record the last received trailers
  @return an implementation of the channel with captures installed.