### Question:
IPv4Pattern implements InetAddressPattern { boolean isValid() { return valid; } IPv4Pattern(String pattern); boolean isMatching(InetAddress address);  }### Answer:
@Test public void test_invalid_pattern_wrong_number() throws Exception{ IPv4Pattern pattern = new IPv4Pattern("256.168.178.*"); assertFalse(pattern.isValid()); }
@Test public void test_invalid_pattern_wrong_amount() throws Exception{ IPv4Pattern pattern = new IPv4Pattern("253.168.178"); assertFalse(pattern.isValid()); }