code: public static boolean isValidArg(String arg) {
      final String[] args = arg.split(":");
      if (args.length != 2) {
        return false;
      }
  
      final String ip = args[1];
      return InetAddresses.isInetAddress(ip);
    }
docs: Validates that the argument has form "host:ip-address". Does not validate the form of the
  hostname argument, but checks that the second half is valid via {@link
  InetAddresses#isInetAddress}.