class SenderIsLocal extends GenericMatcher {

    @Override
    public final Collection<MailAddress> match(Mail mail) {
        if (mail.getMaybeSender().asOptional()
                .map(this::isLocal)
                .orElse(false)) {
            return mail.getRecipients();
        }
        return null;
    }

}