private void loadSchemas(Dbms dbms, Predicate<String> filterCriteria, DbmsType dbmsType, Set<String> discardedSchemas, DatabaseNamingConvention naming) {
        try (final Connection connection = getConnection(dbms)) {
            try (final ResultSet rs = connection.getMetaData().getSchemas(null, null)) {
                while (rs.next()) {

                    final String name = readSchemaName(rs, dbmsType);

                    boolean schemaWasUsed = false;
                    if (!naming.getSchemaExcludeSet().contains(name)&& filterCriteria.test(name)) {
                        extraInfo("loadSchemas used %s", name);
                        final Schema schema = dbms.mutator().addNewSchema();
                        schema.mutator().setId(name);
                        schema.mutator().setName(name);
                        schemaWasUsed = true;
                    } else {
                        extraInfo("loadCatalogs discarded %s", name);
                    }

                    if (!schemaWasUsed) {
                        discardedSchemas.add(name);
                    }
                }
            }
        } 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