* @throws IOException
*/
protected static Pair<LabelMap, Map<Integer, List<UUID>>> populateMailbox() throws IOException
{
Map<Integer, List<UUID>> messages = new HashMap<Integer, List<UUID>>();
LabelMap labels = new LabelMap();
LabelCounters inboxCounters = new LabelCounters();
LabelCounters notifCounters = new LabelCounters();
LabelCounters trashCounters = new LabelCounters();
LabelCounters spamCounters = new LabelCounters();
// INBOX: add 5 messages, mark 2 as unread
messages.put(ReservedLabels.INBOX.getId(), new ArrayList<UUID>());
List<UUID> inboxMessages = messages.get(ReservedLabels.INBOX.getId());
inboxMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.INBOX.getId()));
inboxMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.INBOX.getId()));
inboxMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.INBOX.getId()));
inboxMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.INBOX.getId()));
inboxMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.INBOX.getId()));
markAsRead(inboxMessages.get(3));
markAsRead(inboxMessages.get(4));
inboxCounters.setTotalMessages(5L);
inboxCounters.setUnreadMessages(3L);
labels.put(ReservedLabels.INBOX);
labels.get(ReservedLabels.INBOX.getId()).setCounters(inboxCounters);
// NOTIFICATIONS: add 3 messages, mark 1 as read
messages.put(ReservedLabels.NOTIFICATIONS.getId(), new ArrayList<UUID>());
List<UUID> notifMessages = messages.get(ReservedLabels.NOTIFICATIONS.getId());
notifMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.NOTIFICATIONS.getId()));
notifMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.NOTIFICATIONS.getId()));
notifMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.NOTIFICATIONS.getId()));
markAsRead(notifMessages.get(1));
notifCounters.setTotalMessages(3L);
notifCounters.setUnreadMessages(2L);
labels.put(ReservedLabels.NOTIFICATIONS);
labels.get(ReservedLabels.NOTIFICATIONS.getId()).setCounters(notifCounters);
// SPAM: add 5 messages, keep all unread
messages.put(ReservedLabels.SPAM.getId(), new ArrayList<UUID>());
List<UUID> spamMessages = messages.get(ReservedLabels.SPAM.getId());
spamMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.SPAM.getId()));
spamMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.SPAM.getId()));
spamMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.SPAM.getId()));
spamMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.SPAM.getId()));
spamMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.SPAM.getId()));
spamCounters.setTotalMessages(5L);
spamCounters.setUnreadMessages(5L);
labels.put(ReservedLabels.SPAM);
labels.get(ReservedLabels.SPAM.getId()).setCounters(spamCounters);
// TRASH: add 4 messages, mark 2 as read
messages.put(ReservedLabels.TRASH.getId(), new ArrayList<UUID>());
List<UUID> trashMessages = messages.get(ReservedLabels.TRASH.getId());
trashMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.TRASH.getId()));
trashMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.TRASH.getId()));
trashMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.TRASH.getId()));
trashMessages.add(addMessage(EMAIL_REGULAR, ReservedLabels.TRASH.getId()));
markAsRead(trashMessages.get(0));
markAsRead(trashMessages.get(2));
trashCounters.setTotalMessages(4L);
trashCounters.setUnreadMessages(2L);
labels.put(ReservedLabels.TRASH);
labels.get(ReservedLabels.TRASH.getId()).setCounters(trashCounters);
return Pair.of(labels, messages);
}