class RemoteDeliveryFailedWithSMTPCode extends GenericMatcher {

    @Override
    public Collection<MailAddress> match(Mail mail) {
        return AttributeUtils.getValueAndCastFromMail(mail, DELIVERY_ERROR_CODE, Integer.class)
            .filter(errorCode::equals)
            .map(any -> mail.getRecipients())
            .orElse(ImmutableList.of());
    }

}