@Override
    public InetAddress address(String inetHost, ResolvedAddressTypes resolvedAddressTypes) {
        return firstAddress(addresses(inetHost, resolvedAddressTypes));
    }
@Test
    public void shouldPickIpv6WhenBothAreDefinedButIpv6IsPreferred() {
        HostsFileEntriesProvider.Parser parser = givenHostsParserWith(
                LOCALHOST_V4_ADDRESSES,
                LOCALHOST_V6_ADDRESSES
        );

        DefaultHostsFileEntriesResolver resolver = new DefaultHostsFileEntriesResolver(parser, ENTRIES_TTL);

        InetAddress address = resolver.address("localhost", ResolvedAddressTypes.IPV6_PREFERRED);
        assertThat("Should pick an IPv6 address", address, instanceOf(Inet6Address.class));
    }