@Test
public void testHasUserWithNonEmptyUsername() {

    PasswordsWithUser passwords = new PasswordsWithUser();
    User userWithUsername = new User(1, "foo", null, null, null);
    passwords.setUser(userWithUsername);
    assertTrue(UkelonnServiceProvider.hasUserWithNonEmptyUsername(passwords));
    User userWithEmptyUsername = new User(1, "", null, null, null);
    passwords.setUser(userWithEmptyUsername);
    assertFalse(UkelonnServiceProvider.hasUserWithNonEmptyUsername(passwords));
    User userWithNullUsername = new User(1, null, null, null, null);
    passwords.setUser(userWithNullUsername);
    assertFalse(UkelonnServiceProvider.hasUserWithNonEmptyUsername(passwords));
    passwords.setUser(null);
    assertFalse(UkelonnServiceProvider.hasUserWithNonEmptyUsername(passwords));
}