### Question:
IPMatcher { public boolean match(String ipIn) throws IPMatcherException { byte[] candidate; if (ipIn.indexOf(':') < 0) { candidate = new byte[4]; ipToBytes(ipIn, candidate, true); candidate = ip4ToIp6(candidate); } else try { candidate = Inet6Address.getByName(ipIn).getAddress(); } catch (UnknownHostException e) { throw new IPMatcherException("Malformed IPv6 address ",e); } for (int i = 0; i < netmask.length; i++) { if ((candidate[i] & netmask[i]) != (network[i] & netmask[i])) { return false; } } return true; } IPMatcher(String ipSpec); boolean match(String ipIn);  }### Answer:
@Test public void testIp6FullMatch() throws IPMatcherException { assertTrue("IPv6 full match fails", ip6FullMatcher .match(IP6_FULL_ADDRESS1)); }
@Test public void testIp6MisMatch() throws IPMatcherException { assertFalse("IPv6 full nonmatch succeeds", ip6FullMatcher .match(IP6_FULL_ADDRESS2)); }
@Test public void testIp6MaskedMatch() throws IPMatcherException { assertTrue("IPv6 masked match fails", ip6MaskedMatcher .match(IP6_FULL_ADDRESS2)); }