Usernames { public static void checkValid(String username) { checkValid(username, USERNAME_DEFAULT_REGEX); }  static void checkValid(String username); static void checkValid(String username, String regex); static final String USERNAME_DEFAULT_REGEX; }
@Test public void theseUsernamesAreValid() { Usernames.checkValid("123"); Usernames.checkValid("___"); Usernames.checkValid("---"); Usernames.checkValid("%%%"); Usernames.checkValid("@@@"); Usernames.checkValid("+++"); Usernames.checkValid("1234"); Usernames.checkValid("abcde"); Usernames.checkValid("1aBcDe"); Usernames.checkValid("aBcDe3"); Usernames.checkValid("_kj-ljn@lkj%lkj+kkj"); Usernames.checkValid("vince.mira@toto.fr"); Usernames.checkValid("vince-mira@toto.fr"); }