TextValidator { public static boolean isTel(@Nullable CharSequence input) { return isMatch(PATTERN_REGEX_TEL, 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 isTel() { assertThat(TextValidator.isTel("8802973a")).isFalse(); assertThat(TextValidator.isTel("8908222222")).isFalse(); assertThat(TextValidator.isTel("89081")).isFalse(); assertThat(TextValidator.isTel("89019739")).isTrue(); assertThat(TextValidator.isTel("020-89019739")).isTrue(); }