IPAddressValidator { public static boolean validate(String ip){ pattern = Pattern.compile(IPADDRESS_PATTERN); matcher = pattern.matcher(ip); return matcher.matches(); }  static boolean validate(String ip);  }
@Test public void testValidate_1() throws Exception { String ip = "192.168.0.0"; boolean result = IPAddressValidator.validate(ip); assertEquals(true, result); }
@Test public void testValidate_2() throws Exception { String ip = ""; boolean result = IPAddressValidator.validate(ip); assertEquals(false, result); }