@Test(expected = IllegalArgumentException.class) public void shouldFailToGetPrefixLengthWhenInvalidPrefix() { PrefixUtils.getPrefixLength(Ipv6Range.parse("::0-::2")); }
@Test public void shouldGetPrefixLengthWhenCorrectPrefix() { assertEquals(128, PrefixUtils.getPrefixLength(Ipv6Range.parse("::0-::0"))); assertEquals(128, PrefixUtils.getPrefixLength(Ipv6Range.parse("::1-::1"))); assertEquals(126, PrefixUtils.getPrefixLength(Ipv6Range.parse("::0-::3"))); }