### Question:
RecipientServiceImpl implements RecipientService { @Override @CatAnnotation public Recipient findByAccountName(String accountName) { Assert.hasLength(accountName); return repository.findByAccountName(accountName); }  @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 shouldFindByAccountName() { Recipient recipient = new Recipient(); recipient.setAccountName("test"); when(repository.findByAccountName(recipient.getAccountName())).thenReturn(recipient); Recipient found = recipientService.findByAccountName(recipient.getAccountName()); assertEquals(recipient, found); }
@Test(expected = IllegalArgumentException.class) public void shouldFailToFindRecipientWhenAccountNameIsEmpty() { recipientService.findByAccountName(""); }