code: public List<DBObject> toArray(final int max) {
          checkIteratorOrArray(IteratorOrArray.ARRAY);
          fillArray(max - 1);
          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 failed