@Test public void testValidateEmail() { assertTrue(ValidateUtils.validateEmail("abcd@efg.com")); assertTrue(ValidateUtils.validateEmail("ABCD@efg.com")); assertTrue(ValidateUtils.validateEmail("abc898d@efg.com")); assertTrue(ValidateUtils.validateEmail("abcd@efg.COM")); assertTrue(ValidateUtils.validateEmail("abc@EFG.co")); assertTrue(ValidateUtils.validateEmail("abc@efg.co.in")); assertTrue(ValidateUtils.validateEmail("abcd@efg.com")); assertTrue(ValidateUtils.validateEmail("abcd@efg.in")); assertTrue(ValidateUtils.validateEmail("abcd@efg.bhj")); assertTrue(ValidateUtils.validateEmail("abcd@ef56g.bhj")); assertTrue(ValidateUtils.validateEmail("abc+-%d@abc.com")); assertFalse(ValidateUtils.validateEmail("")); assertFalse(ValidateUtils.validateEmail("abcdefg.com")); assertFalse(ValidateUtils.validateEmail("abc@.com")); assertFalse(ValidateUtils.validateEmail("ab*-c@defg.com")); assertFalse(ValidateUtils.validateEmail("abcd")); assertFalse(ValidateUtils.validateEmail("abc@abc")); assertFalse(ValidateUtils.validateEmail("abc@@hjg.com")); assertFalse(ValidateUtils.validateEmail("abc@abc.co++-")); assertFalse(ValidateUtils.validateEmail("abc@ab/*c")); assertFalse(ValidateUtils.validateEmail("abc@ab/*c.com")); assertFalse(ValidateUtils.validateEmail("abcd@efg.co565m")); assertFalse(ValidateUtils.validateEmail("abcd@ghs.l")); assertFalse(ValidateUtils.validateEmail("abcd@efg.cojjjhjhjhjhjhjhjhm")); }
public static boolean validateEmail(String emailStr) { Matcher matcher = VALID_EMAIL_ADDRESS_REGEX .matcher(emailStr); return matcher.find(); }
ValidateUtils { public static boolean validateEmail(String emailStr) { Matcher matcher = VALID_EMAIL_ADDRESS_REGEX .matcher(emailStr); return matcher.find(); } }
ValidateUtils { public static boolean validateEmail(String emailStr) { Matcher matcher = VALID_EMAIL_ADDRESS_REGEX .matcher(emailStr); return matcher.find(); } private  ValidateUtils(); }
ValidateUtils { public static boolean validateEmail(String emailStr) { Matcher matcher = VALID_EMAIL_ADDRESS_REGEX .matcher(emailStr); return matcher.find(); } private  ValidateUtils(); static boolean validateEmail(String emailStr); static boolean validateUrl(String urlStr); }
ValidateUtils { public static boolean validateEmail(String emailStr) { Matcher matcher = VALID_EMAIL_ADDRESS_REGEX .matcher(emailStr); return matcher.find(); } private  ValidateUtils(); static boolean validateEmail(String emailStr); static boolean validateUrl(String urlStr);  }