@Test
	public void testEvents() throws IOException {

		createIndexedTables(false);

		// Verify table added events
		Table[] tables = dbh.getTables();
		assertEquals(11, tables.length);
		assertEquals(tables.length, listener.events.size());
		int ix = 0;
		for (DbEvent evt : listener.events) {
			assertEquals(DbNotifyType.TABLE_ADDED, evt.type);
			assertEquals("TABLE" + ix, evt.table.getName());
			++ix;
		}

		listener.events.clear();

		// Verify table deleted event
		long txId = dbh.startTransaction();
		Table t = dbh.getTable("TABLE5");
		dbh.deleteTable("TABLE5");
		dbh.endTransaction(txId, true);
		assertEquals(1, listener.events.size());
		DbEvent evt = listener.events.get(0);
		assertEquals(DbNotifyType.TABLE_DELETED, evt.type);
		assertTrue(t == evt.table);

		listener.events.clear();

		dbh.undo();

		assertEquals(1, listener.events.size());
		evt = listener.events.get(0);
		assertEquals(DbNotifyType.RESTORED, evt.type);

		listener.events.clear();

		dbh.redo();

		assertEquals(1, listener.events.size());
		evt = listener.events.get(0);
		assertEquals(DbNotifyType.RESTORED, evt.type);

		listener.events.clear();

		dbh.close();
		dbh = null;

		assertEquals(1, listener.events.size());
		evt = listener.events.get(0);
		assertEquals(DbNotifyType.CLOSED, evt.type);

	}
Test the creation of a new database with indexed and non-indexed tables.
Tests include the removal of tables and are performed for both a stored and
non-stored database.
Ghidra/Framework/DB/src/test/java/db/DBTest.java