code: public synchronized Message[] getByIds(final long start, final long end/* final Folder folder*/) {
          checkExists();
          final List<MockMessage> sms = new ArrayList<MockMessage>();
          int num = 0;
  
          MockMessage lastMsg = null;
  
          for (final MockMessage mockMessage : new TreeSet<MockMessage>(messages.values())) {
  
              lastMsg = mockMessage;
  
              if (end == UIDFolder.LASTUID) {
                  if (getMessageCount() != 1 && mockMessage.getMockid() < start) { // TODO
                                                                                   // check?
                      continue;
                  }
              } else {
                  if (mockMessage.getMockid() < start || mockMessage.getMockid() > end) {
                      continue;
                  }
              }
  
              mockMessage.setMessageNumber(++num);
              // mockMessage.setFolder(folder);
              sms.add(mockMessage);
          }
  
          if (end == UIDFolder.LASTUID && sms.size() == 0) {
              lastMsg.setMessageNumber(++num);
              // lastMsg.setFolder(folder);
              sms.add(lastMsg);
          }
  
          logger.debug("getByIds(" + start + "," + end + " for " + getFullName() + " returns " + sms.size());
          return sms.toArray(new Message[sms.size()]);
      }
docs: private List<Message> unread = new ArrayList<Message>();