@Test public void shouldMatchWhenSenderHostIsLocal() throws MessagingException { Mail mail = FakeMail.builder() .name("mail") .sender(ANY_AT_JAMES) .recipient(ANY_AT_JAMES2) .build(); Collection<MailAddress> actual = matcher.match(mail); assertThat(actual).containsExactly(ANY_AT_JAMES2); }
@Override public Collection<MailAddress> match(Mail mail) { if (mail.getMaybeSender().asOptional() .map(this::isLocalServer) .orElse(false)) { return mail.getRecipients(); } return null; }
SenderHostIsLocal extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { if (mail.getMaybeSender().asOptional() .map(this::isLocalServer) .orElse(false)) { return mail.getRecipients(); } return null; } }
SenderHostIsLocal extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { if (mail.getMaybeSender().asOptional() .map(this::isLocalServer) .orElse(false)) { return mail.getRecipients(); } return null; }  }
SenderHostIsLocal extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { if (mail.getMaybeSender().asOptional() .map(this::isLocalServer) .orElse(false)) { return mail.getRecipients(); } return null; }  @Override Collection<MailAddress> match(Mail mail); }
SenderHostIsLocal extends GenericMatcher { @Override public Collection<MailAddress> match(Mail mail) { if (mail.getMaybeSender().asOptional() .map(this::isLocalServer) .orElse(false)) { return mail.getRecipients(); } return null; }  @Override Collection<MailAddress> match(Mail mail);  }