class Xor extends GenericCompositeMatcher {

    @Override
    public Collection<MailAddress> match(Mail mail) {
        Set<MailAddress> recipients = getMatchers().stream()
            .map(Throwing.<Matcher, Set<MailAddress>>function(matcher -> applyMatcher(mail, matcher)).sneakyThrow())
            .reduce(ImmutableSet.of(), this::performXor);

        if (recipients.isEmpty()) {
            return null;
        }
        return recipients;
    }

}