protected DatabaseObject snapshotObject(DatabaseObject example, DatabaseSnapshot snapshot) throws DatabaseException, InvalidExampleException {
if (!(example instanceof Catalog)) {
throw new UnexpectedLiquibaseException("Unexpected example type: " + example.getClass().getName());
}
Database database = snapshot.getDatabase();
Catalog match = null;
String catalogName = example.getName();
if (catalogName == null && database.supportsCatalogs()) {
catalogName = database.getDefaultCatalogName();
}
example = new Catalog(catalogName);
try {
for (String potentialCatalogName : getDatabaseCatalogNames(database)) {
Catalog catalog = new Catalog(potentialCatalogName);
if (DatabaseObjectComparatorFactory.getInstance().isSameObject(catalog, example, database)) {
if (match == null) {
match = catalog;
} else {
throw new InvalidExampleException("Found multiple catalogs matching " + example.getName());