driver-legacy/src/main/com/mongodb/MongoClient.java
public <T> ListDatabasesIterable<T> listDatabases(final ClientSession clientSession, final Class<T> clazz) {
        notNull("clientSession", clientSession);
        return createListDatabasesIterable(clientSession, clazz);
    }
public <T> ListDatabasesIterable<T> listDatabases(final ClientSession clientSession, final Class<T> clazz) {
        notNull("clientSession", clientSession);
        return createListDatabasesIterable(clientSession, clazz);
    }
Gets the list of databases

@param clientSession the client session with which to associate this operation
@param clazz the class to cast the database documents to
@param <T>   the type of the class to use instead of {@code Document}.
@return the list of databases
@since 3.6
@mongodb.server.release 3.6