code: private static boolean anyInterfaceSupportsIpV6() {
          try {
              Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
              while (interfaces.hasMoreElements()) {
                  NetworkInterface iface = interfaces.nextElement();
                  Enumeration<InetAddress> addresses = iface.getInetAddresses();
                  while (addresses.hasMoreElements()) {
                      if (addresses.nextElement() instanceof Inet6Address) {
                          return true;
                      }
                  }
              }
          } catch (SocketException e) {
              logger.debug("Unable to detect if any interface supports IPv6, assuming IPv4-only", e);
              // ignore
          }
          return false;
      }
docs: Returns {@code true} if any {@link NetworkInterface} supports {@code IPv6}, {@code false} otherwise.