ReverseZoneUtils { @VisibleForTesting protected static long[] splitIp(String baseIp) throws UnknownHostException { InetAddress inetAddress; try { inetAddress = InetAddress.getByName(baseIp); } catch (UnknownHostException e) { LOG.error("Base IP address is invalid"); throw e; } if (inetAddress instanceof Inet6Address) { throw new IllegalArgumentException( "IPv6 is not yet supported for " + "reverse zones"); } byte[] octets = inetAddress.getAddress(); if (octets.length != 4) { throw new IllegalArgumentException("Base IP address is invalid"); } long[] results = new long[4]; for (int i = 0; i < octets.length; i++) { results[i] = octets[i] & 0xff; } return results; } private  ReverseZoneUtils();   }
@Test public void testSplitIp() throws Exception { long[] splitIp = ReverseZoneUtils.splitIp(NET); assertEquals(172, splitIp[0]); assertEquals(17, splitIp[1]); assertEquals(4, splitIp[2]); assertEquals(0, splitIp[3]); }