### Question:
Utils { public static IpPrefix createIpPrefix(String cidr) { checkArgument(!Strings.isNullOrEmpty(cidr), "Cannot be null or empty."); String[] ipAndPrefix = cidr.split("/"); checkArgument(ipAndPrefix.length == 2, "Bad format."); InetAddress ip = InetAddresses.forString(ipAndPrefix[0]); if (ip instanceof Inet4Address) { return new IpPrefix(new Ipv4Prefix(cidr)); } return new IpPrefix(new Ipv6Prefix(cidr)); } private  Utils(); static IpPrefix createIpPrefix(String cidr); static IpAddress createIpAddress(String ipAddress); static String getStringIpPrefix(IpPrefix ipPrefix); static String getStringIpAddress(IpAddress ipAddress); static String normalizeUuid(String string); static void syncNat(ReadWriteTransaction rwTx, Floatingip oldFloatingIp, Floatingip newFloatingIp); static void removeNat(ReadWriteTransaction rwTx, Floatingip removedFloatingIp);  }### Answer:
@Test public final void testCreateIpPrefix_ipv4() { String ipv4Prefix = "1.1.1.1/8"; IpPrefix ipPrefix = Utils.createIpPrefix(ipv4Prefix); Assert.assertNotNull(ipPrefix); Assert.assertNull(ipPrefix.getIpv6Prefix()); assertEquals(ipv4Prefix, ipPrefix.getIpv4Prefix().getValue()); }
@Test public final void testCreateIpPrefix_ipv6() { String ipv6Prefix = "fd1c:29d6:85d1::/48"; IpPrefix ipPrefix = Utils.createIpPrefix(ipv6Prefix); Assert.assertNotNull(ipPrefix); Assert.assertNull(ipPrefix.getIpv4Prefix()); assertEquals(ipv6Prefix, ipPrefix.getIpv6Prefix().getValue()); }
@Test public final void testCreateIpPrefix_null() { thrown.expect(IllegalArgumentException.class); Utils.createIpPrefix(null); }
@Test public final void testCreateIpPrefix_emptyString() { thrown.expect(IllegalArgumentException.class); Utils.createIpPrefix(""); }
@Test public final void testCreateIpPrefix_invalidFormat() { thrown.expect(IllegalArgumentException.class); Utils.createIpPrefix("1.1.1.1/33"); }