docs: public static StackType determineIpVersionFromAddresses(Collection<InetAddress> addrs) throws Exception {
      	Set<InetAddress> ipv4_addrs= new HashSet<>() ;
      	Set<InetAddress> ipv6_addrs= new HashSet<>() ;
  
          for(InetAddress address: addrs) {
              if (address instanceof Inet4Address)
                  ipv4_addrs.add(address) ;
              else
                  ipv6_addrs.add(address) ;
          }
  
          log.trace("all addrs=" + addrs + ", IPv4 addrs=" + ipv4_addrs + ", IPv6 addrs=" + ipv6_addrs);
  
  		// the user supplied 1 or more IP address inputs. Check if we have a consistent set
          if (!addrs.isEmpty()) {
              if (!ipv4_addrs.isEmpty() && !ipv6_addrs.isEmpty()) {
                  throw new RuntimeException("all addresses have to be either IPv4 or IPv6: IPv4 addresses=" +
                          ipv4_addrs + ", IPv6 addresses=" + ipv6_addrs);
              }
              return !ipv6_addrs.isEmpty()? StackType.IPv6 : StackType.IPv4;
          }
          return StackType.Unknown;
      }