### Question:
DefaultDBCleaner implements DBCleaner { public void cleanDatabase() { StructureUtils.assertItemsToPreserveExist(databases, itemsToPreserve); for (Database database : databases.getDatabases()) { for (String schemaName : database.getSchemaNames()) { if (itemsToPreserve.contains(getSchemaIdentifier(schemaName, database))) { continue; } logger.info("Cleaning database schema. Deleting all records from tables in schema " + schemaName); List<String> tableNames = database.getTableNamesSortedAccordingToConstraints(schemaName); for (String tableName : tableNames) { if (itemsToPreserve.contains(getItemIdentifier(TABLE, schemaName, tableName, database))) { continue; } cleanTable(database, schemaName, tableName); } } } } DefaultDBCleaner(Databases databases, Set<DbItemIdentifier> itemsToPreserve, SQLHandler sqlHandler); void cleanDatabase();  }### Answer:
@Test void testCleanDatabase() { assertFalse(isEmpty("TEST_TABLE", dataSource)); assertFalse(isEmpty(defaultDatabase.quoted("Test_CASE_Table"), dataSource)); defaultDBCleaner.cleanDatabase(); assertTrue(isEmpty("TEST_TABLE", dataSource)); assertTrue(isEmpty(defaultDatabase.quoted("Test_CASE_Table"), dataSource)); }
@Test void testCleanDatabase_preserveTablesToPreserve() { assertFalse(isEmpty("TEST_TABLE_PRESERVE", dataSource)); assertFalse(isEmpty(defaultDatabase.quoted("Test_CASE_Table_Preserve"), dataSource)); defaultDBCleaner.cleanDatabase(); assertFalse(isEmpty("TEST_TABLE_PRESERVE", dataSource)); assertFalse(isEmpty(defaultDatabase.quoted("Test_CASE_Table_Preserve"), dataSource)); }