class SetCustomFlagOnBigMessages implements MailboxListener.GroupMailboxListener {

    @Override
    public void event(Event event) {
        if (event instanceof MailboxListener.Added) {
            MailboxListener.Added addedEvent = (MailboxListener.Added) event;
            addedEvent.getUids().stream()
                .filter(messageUid -> isBig(addedEvent, messageUid))
                .forEach(messageUid -> setBigMessageFlag(addedEvent, messageUid));
        }
    }

    @Inject  SetCustomFlagOnBigMessages(MailboxManager mailboxManager);

}