Cast InetAddress to Inet4Address or Inet6Address to call the specific static methods