HttpJsonCallContext implements ApiCallContext { @Override public HttpJsonCallContext withTransportChannel(TransportChannel inputChannel) { Preconditions.checkNotNull(inputChannel); if (!(inputChannel instanceof HttpJsonTransportChannel)) { throw new IllegalArgumentException( "Expected HttpJsonTransportChannel, got " + inputChannel.getClass().getName()); } HttpJsonTransportChannel transportChannel = (HttpJsonTransportChannel) inputChannel; return withChannel(transportChannel.getChannel()); } private  HttpJsonCallContext(
      HttpJsonChannel channel,
      Duration timeout,
      Instant deadline,
      Credentials credentials,
      ImmutableMap<String, List<String>> extraHeaders,
      ApiTracer tracer); static HttpJsonCallContext createDefault(); @Override HttpJsonCallContext nullToSelf(ApiCallContext inputContext); @Override HttpJsonCallContext merge(ApiCallContext inputCallContext); @Override HttpJsonCallContext withCredentials(Credentials newCredentials); @Override HttpJsonCallContext withTransportChannel(TransportChannel inputChannel); @Override HttpJsonCallContext withTimeout(Duration timeout); @Nullable @Override Duration getTimeout(); @Override ApiCallContext withStreamWaitTimeout(@Nonnull Duration streamWaitTimeout); @Nullable @Override Duration getStreamWaitTimeout(); @Override ApiCallContext withStreamIdleTimeout(@Nonnull Duration streamIdleTimeout); @Nullable @Override Duration getStreamIdleTimeout(); @BetaApi("The surface for extra headers is not stable yet and may change in the future.") @Override ApiCallContext withExtraHeaders(Map<String, List<String>> extraHeaders); @BetaApi("The surface for extra headers is not stable yet and may change in the future.") @Override Map<String, List<String>> getExtraHeaders(); HttpJsonChannel getChannel(); Instant getDeadline(); Credentials getCredentials(); HttpJsonCallContext withChannel(HttpJsonChannel newChannel); HttpJsonCallContext withDeadline(Instant newDeadline); @Nonnull @Override ApiTracer getTracer(); @Override HttpJsonCallContext withTracer(@Nonnull ApiTracer newTracer); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testWithTransportChannel() { ManagedHttpJsonChannel channel = Mockito.mock(ManagedHttpJsonChannel.class); HttpJsonCallContext context = HttpJsonCallContext.createDefault() .withTransportChannel( HttpJsonTransportChannel.newBuilder().setManagedChannel(channel).build()); Truth.assertThat(context.getChannel()).isSameInstanceAs(channel); }