RegularUtil { public static boolean isIpAddress(String ip) { return IP.matcher(ip).matches(); }  static boolean isIpAddress(String ip); static boolean isInt(String s); static final Pattern IP; static final Pattern INT; }
@Test public void testIsIpAddress() throws Exception { assertEquals(true, (RegularUtil.isIpAddress("192.168.0.1"))); assertEquals(false, (RegularUtil.isIpAddress("192.168.0.1.1"))); }