### Question:
NameResolverProvider { public int ndots() { return ndots; } 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);  }### Answer:
@Test public void ndots() { assertThat(builder.build().ndots()).isEqualTo(DEFAULT_NDOTS); builder.ndots(4); assertThat(builder.build().ndots()).isEqualTo(4); }
@Test public void ndotsBadValues() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> builder.ndots(-2)) .withMessage("ndots must be greater or equal to -1"); }