DnsEndpointGroupBuilder { public DnsEndpointGroupBuilder serverAddresses(InetSocketAddress... serverAddresses) { return serverAddresses(ImmutableList.copyOf(requireNonNull(serverAddresses, "serverAddresses"))); } DnsEndpointGroupBuilder(String hostname); DnsEndpointGroupBuilder eventLoop(EventLoop eventLoop); DnsEndpointGroupBuilder ttl(int minTtl, int maxTtl); DnsEndpointGroupBuilder queryTimeout(Duration queryTimeout); DnsEndpointGroupBuilder queryTimeoutMillis(long queryTimeoutMillis); DnsEndpointGroupBuilder serverAddresses(InetSocketAddress... serverAddresses); DnsEndpointGroupBuilder serverAddresses(Iterable<InetSocketAddress> serverAddresses); DnsEndpointGroupBuilder backoff(Backoff backoff); DnsEndpointGroupBuilder selectionStrategy(EndpointSelectionStrategy selectionStrategy);  }
@Test void serverAddresses() { assertThat(builder().serverAddressStreamProvider()).isNotNull(); final DnsServerAddressStreamProvider provider = builder().serverAddresses(new InetSocketAddress("1.1.1.1", 53), new InetSocketAddress("1.0.0.1", 53)) .serverAddressStreamProvider(); final DnsServerAddressStream stream = provider.nameServerAddressStream("foo.com"); assertThat(stream.size()).isEqualTo(2); assertThat(stream.next()).isEqualTo(new InetSocketAddress("1.1.1.1", 53)); assertThat(stream.next()).isEqualTo(new InetSocketAddress("1.0.0.1", 53)); assertThat(stream.next()).isEqualTo(new InetSocketAddress("1.1.1.1", 53)); assertThat(stream.next()).isEqualTo(new InetSocketAddress("1.0.0.1", 53)); }