private static boolean hasIPv6Loopback() throws SocketException {
        final Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces();
        for (NetworkInterface iface : Collections.list(ifaces)) {
            final Enumeration<InetAddress> addresses = iface.getInetAddresses();
            for (InetAddress address : Collections.list(addresses)) {
                if (address instanceof Inet6Address && address.isLoopbackAddress()) {
                    return true;
                }
            }
        }
        return false;
    }
A JUnit 5 condition that checks whether the current host has an IPv6 loopback address.

@author Daniel Theuke (daniel.theuke@heuboe.de)
tests/src/test/java/net/devh/boot/grpc/test/util/RequireIPv6Condition.java