public List<DBObject> toArray(final int max) {
        checkIteratorOrArray(IteratorOrArray.ARRAY);
        fillArray(max - 1);
        return all;
    }
public List<DBObject> toArray(final int max) {
        checkIteratorOrArray(IteratorOrArray.ARRAY);
        fillArray(max - 1);
        return all;
    }
public List < DBObject > toArray ( final int max ) { checkIteratorOrArray ( IteratorOrArray . ARRAY ) ; fillArray ( max - 1 ) ; return all ; }
Converts this cursor to an array.

@param max the maximum number of objects to return
@return an array of objects
@throws MongoException if failed
Converts this cursor to an array .