docs: private Map<String, Message> getMessages(Query qry, Folder folder, String[] uids, String[] messageNumbers, int startRow, int maxRow, boolean all) throws MessagingException {
  
  	Message[] messages = folder.getMessages();
  	Map<String, Message> map = qry == null ? new HashMap<String, Message>() : null;
  	int k = 0;
  	if (uids != null || messageNumbers != null) {
  	    startRow = 0;
  	    maxRow = -1;
  	}
  	Message message;
  	for (int l = startRow; l < messages.length; l++) {
  	    if (maxRow != -1 && k == maxRow) {
  		break;
  	    }
  	    message = messages[l];
  	    int messageNumber = message.getMessageNumber();
  	    String id = getId(folder, message);
  
  	    if (uids == null ? messageNumbers == null || contains(messageNumbers, messageNumber) : contains(uids, id)) {
  		k++;
  		if (qry != null) {
  		    toQuery(qry, message, id, all);
  		}
  		else map.put(id, message);
  	    }
  	}
  	return map;
      }