class CommonCatalogSchemaComparator implements DatabaseObjectComparator {
    protected boolean equalsSchemas(Database accordingTo, String schemaName1, String schemaName2) {
        if (CatalogAndSchema.CatalogAndSchemaCase.ORIGINAL_CASE.equals(accordingTo.getSchemaAndCatalogCase())){
            return StringUtil.trimToEmpty(schemaName1).equals(StringUtil.trimToEmpty(schemaName2));
        } else {
            return StringUtil.trimToEmpty(schemaName1).equalsIgnoreCase(StringUtil.trimToEmpty(schemaName2));
        }
    }

    protected String getComparisonSchemaOrCatalog(Database accordingTo, CompareControl.SchemaComparison comparison) {
        if (accordingTo.supports(Schema.class)) {
            return comparison.getComparisonSchema().getSchemaName();
        } else if (accordingTo.supports(Catalog.class)) {
            return comparison.getComparisonSchema().getCatalogName();
        }
        return null;
    }

    protected String getReferenceSchemaOrCatalog(Database accordingTo, CompareControl.SchemaComparison comparison) {<FILL_FUNCTION_BODY>}
}

        if (accordingTo.supports(Schema.class)) {
            return comparison.getReferenceSchema().getSchemaName();
        } else if (accordingTo.supports(Catalog.class)) {
            return comparison.getReferenceSchema().getCatalogName();
        }

        return null;
    
<no_super_class>