### Question:
NetUtils { public static @Nullable Ipv6Address applyMaskOnIpv6Address(@Nullable Ipv6Address ipv6Address, int ipv6MaskLength) { if (ipv6Address == null) { return null; } com.googlecode.ipv6.IPv6Address ip = com.googlecode.ipv6.IPv6Address.fromString(ipv6Address.getValue()); IPv6NetworkMask mask = IPv6NetworkMask.fromPrefixLength(ipv6MaskLength); ip = ip.maskWithNetworkMask(mask); return new Ipv6Address(ip.toString()); }  static int getMaskFromPrefix(@Nullable String prefix); static @Nonnull String getIpAddrFromPrefix(@Nullable String prefix); static @Nullable Ipv6Address applyMaskOnIpv6Prefix(@Nullable Ipv6Prefix ipv6Prefix, int ipv6MaskLength); static @Nullable Ipv6Address applyMaskOnIpv6Address(@Nullable Ipv6Address ipv6Address, int ipv6MaskLength); static boolean samePrefix(@Nullable IpPrefix prefix1, @Nullable IpPrefix prefix2); static boolean isInRange(@Nullable IpPrefix prefix, @Nullable String ipAddress);  }### Answer:
@Test public void testApplyMaskOnIpv6Address_NullAddress () { Ipv6Address result = NetUtils.applyMaskOnIpv6Address(null, 0); Assert.assertNull(result); }
@Test public void testApplyMaskOnIpv6Address_PrefixLengthOutOfRange () { Ipv6Address prefix = new Ipv6Address(IPV6_HOST_ADDRESS); thrown.expect(IllegalArgumentException.class); NetUtils.applyMaskOnIpv6Address(prefix, 130); }
@Test public void testApplyMaskOnIpv6Address_Correct () { Ipv6Address prefix = new Ipv6Address(IPV6_HOST_ADDRESS); Ipv6Address result = NetUtils.applyMaskOnIpv6Address(prefix, 64); Assert.assertTrue(IPV6_NETWORK_ADDRESS_1.equalsIgnoreCase(result.getValue())); }