code: public List<T> toArray(int max) throws MongoException {
          executed();
          if (max > all.size()) {
              List<DBObject> objects = cursor.toArray(max);
              for (int i = all.size(); i < objects.size(); i++) {
                  all.add(jacksonDBCollection.convertFromDbObject(objects.get(i)));
              }
          }
          return all;
      }
docs: Converts this cursor to an array.
  
  @param max the maximum number of objects to return
  @return an array of objects
  @throws MongoException If an error occurred