@Test
public void testLDAPValidUsername() {

    String[] usernames = {
            "f", "fubar", "fubar@myCompany", "fu_bar+100", "fu_bar+100-1", "fu_bar+100-1@myCompany", "fu_bar+100-1@myCompany.com",
            "fubar@myCompany.com"
        };
    Set<String> failures = new TreeSet<>();
    for (String username : usernames) {
        if (!LDAPAuthService._isUsernameValid(username)) {
            failures.add(username);
        }
    }
    assertTrue(failures.toString(), failures.isEmpty());
}