### Question:
UserManager implements Serializable { public int getRegisteredUserCount(Date since) { return databaseModel.getRegisteredUserCount(since); } 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 testGetRegisteredUserCount() { Mockito.when(databaseModel.getRegisteredUserCount(Mockito.any(Date.class))).thenReturn(5); Date since = new Date(); int result = userManager.getRegisteredUserCount(since); Assert.assertEquals(5, result); ArgumentCaptor<Date> dateCaptor = ArgumentCaptor.forClass(Date.class); Mockito.verify(databaseModel).getRegisteredUserCount(dateCaptor.capture()); Assert.assertEquals(since, dateCaptor.getValue()); }