### Question:
IPv6Cidr { public boolean matches(IPv6Cidr oCidr) throws IpTypeMissMatchException, IPStringConversionException { if (oCidr == null) { return false; } if (oCidr.getSubnet() != this.subnet) { return false; } byte[] mySubnet = IPUtils.opBytes(ipBytes, maskBytes, ByteStreamOperation.AND); byte[] theirSubnet = IPUtils.opBytes(oCidr.getIpBytes(), maskBytes, ByteStreamOperation.AND); for (int i = 0; i < mySubnet.length; i++) { if (mySubnet[i] != theirSubnet[i]) { return false; } } return true; } IPv6Cidr();  IPv6Cidr(String cidr); void setCidr(String in); boolean contains(String ip); boolean matches(IPv6Cidr oCidr); String getExpandedIPv6Cidr(String cidr); String getCidr(); String getIp(); int getSubnet(); byte[] getIpBytes(); byte[] getMaskBytes();  }### Answer:
@Test public void shouldMatchCidrs() throws IPStringConversionException, IpTypeMissMatchException{ IPv6Cidr cidr1 = new IPv6Cidr("cccc:cccc:cccc:cccc::192.168.3.51/64"); IPv6Cidr cidr2 = new IPv6Cidr("cccc:cccc:cccc:cccc:aaaa:aaaa:aaaa:aaaa/64"); assertTrue(cidr1.matches(cidr2)); }
@Test public void shouldnotMatch() throws IpTypeMissMatchException, IPStringConversionException { IPv6Cidr cidr1 = new IPv6Cidr("cccc:cccc:cccc:cccc::192.168.3.51/64"); IPv6Cidr cidr2 = new IPv6Cidr("cccc:ffff:cccc:cccc:aaaa:aaaa:aaaa:aaaa/64"); assertFalse(cidr1.matches(cidr2)); }