public static int ipToInt(String ip) {
        try {
            return bytesToInt(ipToBytesByInet(ip));
        } catch (Exception e) {
            throw new IllegalArgumentException(ip + " is invalid IP");
        }
    }
@Test
    void testIpToInt() {
        assertEquals(2130706433, InternetAddressUtil.ipToInt("127.0.0.1"));
        assertEquals(-1062731775, InternetAddressUtil.ipToInt("192.168.0.1"));
    }