### Question:
IpPrefix { public static IpPrefix<Ipv4Address> fromIpv4(String ip) { final String[] tokens = ip.split("/"); final IpAddress ipAddress = IpAddress.fromIp(tokens[0]); final int mask = Integer.parseInt(tokens[1]); if (ipAddress instanceof Ipv4Address) { Assert.isTrue(mask >= 0 && mask <= MAX_IPV4_MASK, () -> "Mask must be in range <0;" + MAX_IPV4_MASK + ">"); return new IpPrefix<>((Ipv4Address) ipAddress, mask); } throw new IllegalArgumentException("Invalid ipv4 " + ip); } private  IpPrefix(final T address, final int mask); T getAddress(); int getMask(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static IpPrefix<Ipv4Address> fromIpv4(String ip); static IpPrefix<Ipv6Address> fromIpv6(String ip);  }### Answer:
@Test public void should_fail_to_parse_ipv6_as_ipv4_prefix() { assertThrows(IllegalArgumentException.class, () -> IpPrefix.fromIpv4("::1/128")); }
@Test public void should_fail_to_parse_ipv4_prefix_with_invalid_mask() { assertThrows(IllegalArgumentException.class, () -> IpPrefix.fromIpv4("127.0.0.0/-1")); assertThrows(IllegalArgumentException.class, () -> IpPrefix.fromIpv4("127.0.0.0/33")); }