NameResolverProvider { public int maxPayloadSize() { return maxPayloadSize; } 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 maxPayloadSize() { assertThat(builder.build().maxPayloadSize()).isEqualTo(DEFAULT_MAX_PAYLOAD_SIZE); builder.maxPayloadSize(1024); assertThat(builder.build().maxPayloadSize()).isEqualTo(1024); }
@Test public void maxPayloadSizeBadValues() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> builder.maxPayloadSize(0)) .withMessage("maxPayloadSize must be positive"); }