NameResolverProvider { public Duration cacheNegativeTimeToLive() { return cacheNegativeTimeToLive; } NameResolverProvider(Build build); static NameResolverSpec builder(); Duration cacheMaxTimeToLive(); Duration cacheMinTimeToLive(); Duration cacheNegativeTimeToLive(); boolean isDisableOptionalRecord(); boolean isDisableRecursionDesired(); boolean isPreferNative(); boolean isRoundRobinSelection(); @Nullable LoopResources loopResources(); int maxPayloadSize(); int maxQueriesPerResolve(); int ndots(); Duration queryTimeout(); @Nullable ResolvedAddressTypes resolvedAddressTypes(); @Nullable Iterable<String> searchDomains(); @Override boolean equals(Object o); @Override int hashCode(); DnsAddressResolverGroup newNameResolverGroup(LoopResources defaultLoopResources, boolean defaultPreferNative);  }
@Test public void cacheNegativeTimeToLive() { assertThat(builder.build().cacheNegativeTimeToLive()).isEqualTo(DEFAULT_CACHE_NEGATIVE_TIME_TO_LIVE); Duration cacheNegativeTimeToLive = Duration.ofSeconds(5); builder.cacheNegativeTimeToLive(cacheNegativeTimeToLive); assertThat(builder.build().cacheNegativeTimeToLive()).isEqualTo(cacheNegativeTimeToLive); }