### Question:
RecipientServiceImpl implements RecipientService { @Override @CatAnnotation public Recipient save(String accountName, Recipient recipient) { recipient.setAccountName(accountName); recipient.getScheduledNotifications().values() .forEach(settings -> { if (settings.getLastNotified() == null) { settings.setLastNotified(new Date()); } }); repository.save(recipient); log.info("recipient {} settings has been updated", recipient); return recipient; }  @Override @CatAnnotation Recipient findByAccountName(String accountName); @Override @CatAnnotation Recipient save(String accountName, Recipient recipient); @Override @CatAnnotation List<Recipient> findReadyToNotify(NotificationType type); @Override @CatAnnotation void markNotified(NotificationType type, Recipient recipient);  }### Answer:
@Test public void shouldSaveRecipient() { NotificationSettings remind = new NotificationSettings(); remind.setActive(true); remind.setFrequency(Frequency.WEEKLY); remind.setLastNotified(null); NotificationSettings backup = new NotificationSettings(); backup.setActive(false); backup.setFrequency(Frequency.MONTHLY); backup.setLastNotified(new Date()); Recipient recipient = new Recipient(); recipient.setEmail("test@test.com"); recipient.setScheduledNotifications(ImmutableMap.of( NotificationType.BACKUP, backup, NotificationType.REMIND, remind )); Recipient saved = recipientService.save("test", recipient); verify(repository).save(recipient); assertNotNull(saved.getScheduledNotifications().get(NotificationType.REMIND).getLastNotified()); assertEquals("test", saved.getAccountName()); }