HttpJsonCallContext implements ApiCallContext { @Override public HttpJsonCallContext withTimeout(Duration timeout) { if (timeout != null && (timeout.isZero() || timeout.isNegative())) { timeout = null; } if (timeout != null && this.timeout != null && this.timeout.compareTo(timeout) <= 0) { return this; } return new HttpJsonCallContext( this.channel, timeout, this.deadline, this.credentials, this.extraHeaders, this.tracer); } 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 testWithTimeout() { Truth.assertThat(HttpJsonCallContext.createDefault().withTimeout(null).getTimeout()).isNull(); }