StringUtils { public static boolean isValidEmail(String value) { if (value == null) { return true; } return value.matches(EMAIL_PATTERN); } private  StringUtils(); static String camelCaseToHumanFriendly(String camelCaseString, boolean capitalize); static String getHtmlLineBreak(); static boolean isValidEmail(String value); static String prependProtocol(String value); static String propertyIdToHumanFriendly(Object propertyId, boolean capitalize); static String restrictToMaxFieldLength(String value, Class<?> clazz, String fieldName); static final String HTML_LINE_BREAK; }
@Test public void testIsValidEmail() { assertFalse(StringUtils.isValidEmail(" ")); assertFalse(StringUtils.isValidEmail("")); assertFalse(StringUtils.isValidEmail("@")); assertTrue(StringUtils.isValidEmail("a@b.com")); assertFalse(StringUtils.isValidEmail("a@b")); assertTrue(StringUtils.isValidEmail("kevin@opencirclesolutions.nl")); }