StringUtils { public static boolean isEmailValid(@NonNull final String email) { Preconditions.checkNotNull(email, "email"); boolean isValid = false; if (pattern == null) { pattern = Pattern.compile(EMAIL_PATTERN); } isValid = pattern.matcher(email).matches(); return isValid; } private  StringUtils(); static boolean isEmailValid(@NonNull final String email); static boolean isBlank(@Nullable final CharSequence text); static boolean isBlank(@Nullable final String text); @NonNull static String getFirstCapitalize(@NonNull String text); @NonNull static String getAllCapitalize(@NonNull String text);  }
@Test public void testIsEmailValidWithWrongEmail2() { assertThat(StringUtils.isEmailValid("this_is_wrong@aaaa"), is(false)); }
@Test public void testIsEmailValidWithWrongEmail3() { assertThat(StringUtils.isEmailValid("this_is_wrong@aaaa."), is(false)); }
@Test public void testIsEmailValidWithWrongEmail4() { assertThat(StringUtils.isEmailValid("this_is_wrong@aaaa.c"), is(false)); }
@Test public void testIsEmailValidWithWrongEmail5() { assertThat(StringUtils.isEmailValid("this_is_wrong@aaaa.co@"), is(false)); }
@Test public void testIsEmailValidWithCorrect() { assertThat(StringUtils.isEmailValid("this_is_correct@aaaa.com"), is(true)); }
@Test public void testIsEmailValidWithEmpty() { assertThat(StringUtils.isEmailValid(""), is(false)); }
@Test(expected = NullPointerException.class) public void testIsEmailValidWithNull() { StringUtils.isEmailValid(null); }
@Test public void testIsEmailValidWithWrongEmail1() { assertThat(StringUtils.isEmailValid("this_is_wrong@"), is(false)); }