### Question:
NetUtils { public static @Nullable Ipv6Address applyMaskOnIpv6Prefix(@Nullable Ipv6Prefix ipv6Prefix, int ipv6MaskLength) { if (ipv6Prefix == null) { return null; } return applyMaskOnIpv6Address(new Ipv6Address(getIpAddrFromPrefix(ipv6Prefix.getValue())), ipv6MaskLength); }  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 testApplyMaskOnIpv6Prefix_NullPrefix () { Ipv6Address result = NetUtils.applyMaskOnIpv6Prefix(null, 0); Assert.assertNull(result); }
@Test public void testApplyMaskOnIpv6Prefix_PrefixLengthOutOfRange () { Ipv6Prefix prefix = new Ipv6Prefix(IPV6_HOST_ADDRESS + MASK_64); thrown.expect(IllegalArgumentException.class); NetUtils.applyMaskOnIpv6Prefix(prefix, 130); }
@Test public void testApplyMaskOnIpv6Prefix_Correct () { Ipv6Prefix prefix = new Ipv6Prefix(IPV6_HOST_ADDRESS + MASK_64); Ipv6Address result = NetUtils.applyMaskOnIpv6Prefix(prefix, 64); Assert.assertTrue(IPV6_NETWORK_ADDRESS_1.equalsIgnoreCase(result.getValue())); }