docs: private static Inet4Address getIPv4Address(String iface)
            throws SocketException, UnsupportedAddressTypeException,
            UnknownHostException {
      if (iface != null) {
        Enumeration<InetAddress> addresses =
                NetworkInterface.getByName(iface).getInetAddresses();
        while (addresses.hasMoreElements()) {
          InetAddress addr = addresses.nextElement();
          if (addr instanceof Inet4Address) {
            return (Inet4Address) addr;
          }
        }
      }
  
      InetAddress localhost = InetAddress.getLocalHost();
      if (localhost instanceof Inet4Address) {
        return (Inet4Address) localhost;
      }
  
      throw new UnsupportedAddressTypeException();
    }