private void loadCatalogs(Dbms dbms, Predicate<String> filterCriteria, Set<String> discardedSchemas, DatabaseNamingConvention naming) {
        try (final Connection connection = getConnection(dbms)) {
            try (final ResultSet catalogResultSet = connection.getMetaData().getCatalogs()) {
                while (catalogResultSet.next()) {
                    final String schemaName = catalogResultSet.getString(1);
                    boolean schemaWasUsed = false;
                    if (filterCriteria.test(schemaName) && !naming.getSchemaExcludeSet().contains(schemaName)) {
                        extraInfo("loadCatalogs used %s", schemaName);
                        final Schema schema = dbms.mutator().addNewSchema();
                        schema.mutator().setId(schemaName);
                        schema.mutator().setName(schemaName);
                        schemaWasUsed = true;
                    } else {
                        extraInfo("loadCatalogs discarded %s", schemaName);
                    }

                    if (!schemaWasUsed) {
                        discardedSchemas.add(schemaName);
                    }
                }
            }
        } catch (final SQLException sqle) {
            throw new SpeedmentException(
                "Error reading metadata from result set.", sqle
            );
        }
    }
@author  Emil Forslund
@author  Per Minborg
@since   3.0.0
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/abstracts/AbstractDbmsMetadataHandler.java