comparator);
Iterator<MBMessage> itr = messageList.iterator();
lastIntervalStart += max;
listNotExhausted = (messageList.size() == max);
while (itr.hasNext() && (messages.size() < max)) {
<BUG>MBMessage message = itr.next();
if (MBMessagePermission.contains(
getPermissionChecker(), message, ActionKeys.VIEW)) {
</BUG>
messages.add(message);

comparator);
Iterator<MBMessage> itr = messageList.iterator();
lastIntervalStart += max;
listNotExhausted = (messageList.size() == max);
while (itr.hasNext() && (messages.size() < max)) {
MBMessage message = itr.next();
MBThread thread = mbThreadLocalService.getThread(message.getThreadId());
if (MBMessagePermission.contains(
getPermissionChecker(), message, ActionKeys.VIEW) && MBMessagePermission.contains(
getPermissionChecker(), thread.getRootMessageId(), ActionKeys.VIEW)) {
messages.add(message);
