class PostmasterAlias extends GenericMailet {

    @Override
    public void service(Mail mail) throws MessagingException {
        Collection<MailAddress> postmasterAliases = mail.getRecipients()
            .stream()
            .filter(this::isPostmasterAlias)
            .collect(Guavate.toImmutableList());

        if (!postmasterAliases.isEmpty()) {
            mail.setRecipients(
                Stream.concat(
                    mail.getRecipients()
                        .stream()
                        .filter(address -> !postmasterAliases.contains(address)),
                    Stream.of(getMailetContext().getPostmaster()))
                .collect(Guavate.toImmutableSet()));
        }
    }

}