Flags updated = new Flags();
updated.add(Flags.Flag.ANSWERED);
updated.add(Flags.Flag.DRAFT);
updated.add(Flags.Flag.SEEN);
dispatcher.flagsUpdated(session, Arrays.asList(result.getUid()), mailbox, Arrays.asList(new UpdatedFlags(result.getUid(), -1, originals, updated)));
assertEquals(1, collector.events.size());
assertTrue(collector.events.get(0) instanceof MailboxListener.FlagsUpdated);
MailboxListener.FlagsUpdated event = (MailboxListener.FlagsUpdated) collector.events
.get(0);
Iterator<Flags.Flag> iterator = event.getUpdatedFlags().get(0).systemFlagIterator();