code: private static boolean isValidAddress(InetAddress address, int timeoutMs) throws IOException {
      return !address.isAnyLocalAddress() && !address.isLinkLocalAddress()
          && !address.isLoopbackAddress() && address.isReachable(timeoutMs)
          && (address instanceof Inet4Address);
    }
docs: Tests if the address is externally resolvable. Address must not be wildcard, link local,
  loopback address, non-IPv4, or other unreachable addresses.
  
  @param address The testing address
  @param timeoutMs Timeout in milliseconds to use for checking that a possible local IP is
  reachable
  @return a {@code boolean} indicating if the given address is externally resolvable address