### Question:
PasswordReminderServiceImpl implements PasswordReminderService { @Override @Transactional public void generateAndSendNewPassword(final String userName) throws UsernameNotFoundException { Preconditions.checkArgument(StringUtils.isNotEmpty(userName), "user name should not be empty"); Entity userEntity = getUserEntity(userName); String userEmail = userEntity.getStringField("email"); if (!MailServiceImpl.isValidEmail(userEmail)) { throw new InvalidMailAddressException("invalid recipient email address"); } Preconditions.checkNotNull(userEmail, "e-mail for user " + userName + " was not specified."); String newPassword = passwordGeneratorService.generatePassword(); updateUserPassword(userEntity, newPassword); sendNewPassword(userEmail, userName, newPassword); }  @Override @Transactional void generateAndSendNewPassword(final String userName);  }### Answer:
@Test(expected = UsernameNotFoundException.class) public final void shouldThrowExceptionIfUserDoesNotExists() throws Exception { passwordReminderServiceImpl.generateAndSendNewPassword("someNoneExistentUser"); }
@Test(expected = IllegalArgumentException.class) public final void shouldThrowExceptionIfUserNameIsNull() throws Exception { passwordReminderServiceImpl.generateAndSendNewPassword(null); }
@Test(expected = IllegalArgumentException.class) public final void shouldThrowExceptionIfUserNameIsEmpty() throws Exception { passwordReminderServiceImpl.generateAndSendNewPassword(""); }