TextValidator { public static boolean isEmail(@Nullable CharSequence input) { return isMatch(PATTERN_REGEX_EMAIL, input); }  static boolean isMobileSimple(@Nullable CharSequence input); static boolean isMobileExact(@Nullable CharSequence input); static boolean isTel(@Nullable CharSequence input); static boolean isIdCard(@Nullable CharSequence input); static boolean isEmail(@Nullable CharSequence input); static boolean isUrl(@Nullable CharSequence input); static boolean isDate(@Nullable CharSequence input); static boolean isIp(@Nullable CharSequence input); static boolean isMatch(Pattern pattern, CharSequence input); static final String REGEX_MOBILE_EXACT; }
@Test public void isEmail() { assertThat(TextValidator.isEmail("abc")).isFalse(); assertThat(TextValidator.isEmail("abc@a")).isFalse(); assertThat(TextValidator.isEmail("中文@a.com")).isFalse(); assertThat(TextValidator.isEmail("abc@abc.com")).isTrue(); }