### Question:
UserManager implements Serializable { public PasswordCheckResult checkPassword(String password, String passwordConfirmation) { if (password == null || password.isEmpty()) { return PasswordCheckResult.PASSWORD_EMPTY; } if (password.length() < properties.getMinPasswordLength()) { return PasswordCheckResult.PASSWORD_TOO_SHORT; } if (passwordConfirmation == null || passwordConfirmation.isEmpty()) { return PasswordCheckResult.PASSWORD_CONFIRMATION_EMPTY; } if (!passwordConfirmation.equals(password)) { return PasswordCheckResult.PASSWORD_CONFIRMATION_MISMATCH; } return PasswordCheckResult.OK; } UserManager(); ResultCode cancelPasswordResetTokens(int userId); ResultCode cancelRegistration(int userId, String password); ResultCode changePassword(int userId, String oldPassword, String newPassword); PasswordCheckResult checkPassword(String password, String passwordConfirmation); ResultCode confirmManualRegistration(String email, String registrationControlCode, String password); ResultCode confirmRegistration(String email, String registrationControlCode); ResultCode createPasswordResetToken(String email); User getCurrentUser(); int getRegisteredUserCount(Date since); boolean isPasswordResetTokenValid(String email, String tokenKey); boolean isPasswordValid(int userId, String password); ResultCode logIn(String userNameOrEmail, String password, String usersIp); User loginOrRegisterWithSocialAccount(SocialAccountDetails details, String usersIp); ResultCode logInWithoutPassword(String userNameOrEmail); void logOut(); ResultCode registerUser(String email, String name, String password, boolean registrationConfirmed); ResultCode registerUserManually(String email, String name, int rank); ResultCode resendRegistrationEmail(String address); ResultCode resetPassword(String userEmail, String tokenKey, String newPassword); boolean sendTestingEmail(EmailType emailType, String address);  }### Answer:
@Test public void testCheckPassword() { PasswordCheckResult result = userManager.checkPassword(null, null); Assert.assertEquals(PasswordCheckResult.PASSWORD_EMPTY, result); result = userManager.checkPassword("", null); Assert.assertEquals(PasswordCheckResult.PASSWORD_EMPTY, result); result = userManager.checkPassword("abcd", null); Assert.assertEquals(PasswordCheckResult.PASSWORD_TOO_SHORT, result); result = userManager.checkPassword("abcdef", null); Assert.assertEquals(PasswordCheckResult.PASSWORD_CONFIRMATION_EMPTY, result); result = userManager.checkPassword("abcdef", ""); Assert.assertEquals(PasswordCheckResult.PASSWORD_CONFIRMATION_EMPTY, result); result = userManager.checkPassword("abcdef", "abcd"); Assert.assertEquals(PasswordCheckResult.PASSWORD_CONFIRMATION_MISMATCH, result); result = userManager.checkPassword("abcdef", "abcdef"); Assert.assertEquals(PasswordCheckResult.OK, result); }