public static DnsServerAddresses singleton(final InetSocketAddress address) {
        checkNotNull(address, "address");
        if (address.isUnresolved()) {
            throw new IllegalArgumentException("cannot use an unresolved DNS server address: " + address);
        }

        return new SingletonDnsServerAddresses(address);
    }
@Test
    public void testSingleton() {
        DnsServerAddresses seq = DnsServerAddresses.singleton(ADDR1);

        // Should return the same iterator instance for least possible footprint.
        assertThat(seq.stream(), is(sameInstance(seq.stream())));

        DnsServerAddressStream i = seq.stream();
        assertNext(i, ADDR1);
        assertNext(i, ADDR1);
        assertNext(i, ADDR1);
    }