@Test public void getRecipientsShouldReturnEmptyWhenMailetRecipientsContainsOnlyUnaltered() throws Exception { when(mailet.getRecipients()) .thenReturn(ImmutableList.of(SpecialAddress.UNALTERED)); FakeMail fakeMail = FakeMail.defaultFakeMail(); List<MailAddress> recipients = testee.getRecipients(fakeMail); assertThat(recipients).isEmpty(); }
public List<MailAddress> getRecipients(Mail originalMail) throws MessagingException { List<MailAddress> recipients = mailet.getRecipients(); if (!recipients.isEmpty()) { if (containsOnlyUnalteredOrRecipients(recipients)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceSpecialAddresses(originalMail, recipients); } return ImmutableList.of(); }
RecipientsUtils { public List<MailAddress> getRecipients(Mail originalMail) throws MessagingException { List<MailAddress> recipients = mailet.getRecipients(); if (!recipients.isEmpty()) { if (containsOnlyUnalteredOrRecipients(recipients)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceSpecialAddresses(originalMail, recipients); } return ImmutableList.of(); } }
RecipientsUtils { public List<MailAddress> getRecipients(Mail originalMail) throws MessagingException { List<MailAddress> recipients = mailet.getRecipients(); if (!recipients.isEmpty()) { if (containsOnlyUnalteredOrRecipients(recipients)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceSpecialAddresses(originalMail, recipients); } return ImmutableList.of(); } private  RecipientsUtils(RedirectNotify mailet); }
RecipientsUtils { public List<MailAddress> getRecipients(Mail originalMail) throws MessagingException { List<MailAddress> recipients = mailet.getRecipients(); if (!recipients.isEmpty()) { if (containsOnlyUnalteredOrRecipients(recipients)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceSpecialAddresses(originalMail, recipients); } return ImmutableList.of(); } private  RecipientsUtils(RedirectNotify mailet); static RecipientsUtils from(RedirectNotify mailet); List<MailAddress> getRecipients(Mail originalMail); }
RecipientsUtils { public List<MailAddress> getRecipients(Mail originalMail) throws MessagingException { List<MailAddress> recipients = mailet.getRecipients(); if (!recipients.isEmpty()) { if (containsOnlyUnalteredOrRecipients(recipients)) { return ImmutableList.of(); } return SpecialAddressesUtils.from(mailet).replaceSpecialAddresses(originalMail, recipients); } return ImmutableList.of(); } private  RecipientsUtils(RedirectNotify mailet); static RecipientsUtils from(RedirectNotify mailet); List<MailAddress> getRecipients(Mail originalMail);  }