### Question:
IpUtils { public static Long ipToLong(String ipStr) { String[] ipSet = ipStr.split("\\" + DOT); return Long.parseLong(ipSet[0]) << 24 | Long.parseLong(ipSet[1]) << 16 | Long.parseLong(ipSet[2]) << 8 | Long.parseLong(ipSet[3]); } private  IpUtils(); static Long ipToLong(String ipStr); static String longToIp(long ipLong); static final String DOT; }### Answer:
@Test public void ipToLong() { String ip = "192.168.110.1"; String ip2 = "0.0.0.0"; long longNumber = IpUtils.ipToLong(ip); long longNumber2 = IpUtils.ipToLong(ip2); System.out.println(longNumber); Assert.assertEquals(3232263681L, longNumber); Assert.assertEquals(0L, longNumber2); String ip3 = "255.255.255.255"; long longNumber3 = IpUtils.ipToLong(ip3); System.out.println(longNumber3); Assert.assertEquals(4294967295L, longNumber3); }