### Question:
Utils { public static IpAddress createIpAddress(String ipAddress) { checkArgument(!Strings.isNullOrEmpty(ipAddress), "Cannot be null or empty."); InetAddress ip = InetAddresses.forString(ipAddress); if (ip instanceof Inet4Address) { return new IpAddress(new Ipv4Address(ipAddress)); } return new IpAddress(new Ipv6Address(ipAddress)); } 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 testCreateIpAddress_ipv4() { String ipv4Address = "1.1.1.1"; IpAddress ipAddress = Utils.createIpAddress(ipv4Address); Assert.assertNotNull(ipAddress); Assert.assertNull(ipAddress.getIpv6Address()); assertEquals(ipv4Address, ipAddress.getIpv4Address().getValue()); }
@Test public final void testCreateIpAddress_ipv6() { String ipv6Address = "2001:db8::211:22ff:fe33:4455"; IpAddress ipAddress = Utils.createIpAddress(ipv6Address); Assert.assertNotNull(ipAddress); Assert.assertNull(ipAddress.getIpv4Address()); assertEquals(ipv6Address, ipAddress.getIpv6Address().getValue()); }
@Test public final void testCreateIpAddress_null() { thrown.expect(IllegalArgumentException.class); Utils.createIpAddress(null); }
@Test public final void testCreateIpAddress_emptyString() { thrown.expect(IllegalArgumentException.class); Utils.createIpAddress(""); }
@Test public final void testCreateIpAddress_invalidFormat() { thrown.expect(IllegalArgumentException.class); Utils.createIpAddress("1.1.1.256"); }