+
+ @Test
+ public void testIpv4ZoneStripping() {
+ final Ipv4AddressNoZone noZone = new Ipv4AddressNoZone("1.2.3.4");
+ assertSame(noZone, IetfInetUtil.INSTANCE.ipv4AddressNoZoneFor(noZone));
+
+ final Ipv4Address withoutZone = new Ipv4Address(noZone);
+ final Ipv4AddressNoZone stripped = IetfInetUtil.INSTANCE.ipv4AddressNoZoneFor(withoutZone);
+ assertSame(withoutZone.getValue(), stripped.getValue());
+
+ assertEquals(noZone, IetfInetUtil.INSTANCE.ipv4AddressNoZoneFor(new Ipv4Address("1.2.3.4%1")));
+ }
+
+ @Test
+ public void testIpv6ZoneStripping() {
+ final Ipv6AddressNoZone noZone = new Ipv6AddressNoZone("ff00::");
+ assertSame(noZone, IetfInetUtil.INSTANCE.ipv6AddressNoZoneFor(noZone));
+
+ final Ipv6Address withoutZone = new Ipv6Address(noZone);
+ final Ipv6AddressNoZone stripped = IetfInetUtil.INSTANCE.ipv6AddressNoZoneFor(withoutZone);
+ assertSame(withoutZone.getValue(), stripped.getValue());
+
+ assertEquals(noZone, IetfInetUtil.INSTANCE.ipv6AddressNoZoneFor(new Ipv6Address("ff00::%1")));
+ }
+}