public static String getLocalIp(String... preferredNetworks) {
        InetAddress address = getLocalAddress(preferredNetworks);
        if (null != address) {
            String hostAddress = address.getHostAddress();
            if (address instanceof Inet6Address) {
                if (hostAddress.contains("%")) {
                    hostAddress = hostAddress.substring(0, hostAddress.indexOf("%"));
                }
            }
            return hostAddress;
        }
        return localIP();
    }
@Test
    public void testGetLocalIp() {
        assertThat(NetUtil.getLocalIp()).isNotNull();
    }