@Test public void serviceShouldPutRecipientToLowerCase() throws Exception { FakeMail fakeMail = FakeMail.builder() .name("mail") .recipient("THienan1234@gmail.com") .build(); testee.service(fakeMail); Collection<MailAddress> recipients = fakeMail.getRecipients(); assertThat(recipients) .extracting(MailAddress::asString) .containsOnly("thienan1234@gmail.com"); }
@Override public void service(Mail mail) throws MessagingException { mail.setRecipients(mail.getRecipients().stream() .map(Throwing.function(this::toLowerCase)) .collect(Guavate.toImmutableList())); }
RecipientToLowerCase extends GenericMailet { @Override public void service(Mail mail) throws MessagingException { mail.setRecipients(mail.getRecipients().stream() .map(Throwing.function(this::toLowerCase)) .collect(Guavate.toImmutableList())); } }
RecipientToLowerCase extends GenericMailet { @Override public void service(Mail mail) throws MessagingException { mail.setRecipients(mail.getRecipients().stream() .map(Throwing.function(this::toLowerCase)) .collect(Guavate.toImmutableList())); }  }
RecipientToLowerCase extends GenericMailet { @Override public void service(Mail mail) throws MessagingException { mail.setRecipients(mail.getRecipients().stream() .map(Throwing.function(this::toLowerCase)) .collect(Guavate.toImmutableList())); }  @Override void service(Mail mail); }
RecipientToLowerCase extends GenericMailet { @Override public void service(Mail mail) throws MessagingException { mail.setRecipients(mail.getRecipients().stream() .map(Throwing.function(this::toLowerCase)) .collect(Guavate.toImmutableList())); }  @Override void service(Mail mail);  }