### Question:
CallOptions { @Override public String toString() { return MoreObjects.toStringHelper(this) .add("deadline", deadline) .add("authority", authority) .add("callCredentials", credentials) .add("executor", executor != null ? executor.getClass() : null) .add("compressorName", compressorName) .add("customOptions", Arrays.deepToString(customOptions)) .add("waitForReady", isWaitForReady()) .add("maxInboundMessageSize", maxInboundMessageSize) .add("maxOutboundMessageSize", maxOutboundMessageSize) .add("streamTracerFactories", streamTracerFactories) .toString(); } private  CallOptions(); private  CallOptions(CallOptions other); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") CallOptions withAuthority(@Nullable String authority); CallOptions withCallCredentials(@Nullable CallCredentials credentials); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") CallOptions withCompression(@Nullable String compressorName); CallOptions withDeadline(@Nullable Deadline deadline); CallOptions withDeadlineAfter(long duration, TimeUnit unit); @Nullable Deadline getDeadline(); CallOptions withWaitForReady(); CallOptions withoutWaitForReady(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") @Nullable String getCompressor(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") String getAuthority(); @Nullable CallCredentials getCredentials(); CallOptions withExecutor(Executor executor); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861") CallOptions withStreamTracerFactory(ClientStreamTracer.Factory factory); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861") List<ClientStreamTracer.Factory> getStreamTracerFactories(); CallOptions withOption(Key<T> key, T value); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1869") @SuppressWarnings("unchecked") T getOption(Key<T> key); @Nullable Executor getExecutor(); boolean isWaitForReady(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") CallOptions withMaxInboundMessageSize(int maxSize); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") CallOptions withMaxOutboundMessageSize(int maxSize); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") Integer getMaxInboundMessageSize(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") Integer getMaxOutboundMessageSize(); @Override String toString(); static final CallOptions DEFAULT; }### Answer:
@Test public void toStringMatches_noDeadline() { String actual = CallOptions.DEFAULT.toString(); assertThat(actual).contains("deadline=null"); }
@Test public void toStringMatches_withDeadline() { assertThat(allSet.toString()).contains("1 ns from now"); }