private void createIndexedTables(boolean testStoredDB) throws IOException {

		// Create table for each schema defined by DBTestUtils
		// All schema fields are indexed
		long txId = dbh.startTransaction();
		for (int i = 0; i <= DBTestUtils.MAX_SCHEMA_TYPE; i++) {
			DBTestUtils.createLongKeyTable(dbh, "TABLE" + i, i, true, false);
		}
		assertEquals(DBTestUtils.MAX_SCHEMA_TYPE + 1, dbh.getTableCount());
		dbh.endTransaction(txId, true);

		if (testStoredDB) {
			saveAsAndReopen(dbName);
			assertEquals(DBTestUtils.MAX_SCHEMA_TYPE + 1, dbh.getTableCount());
		}

		// Check Master Table entries
		TableRecord[] tableRecords = dbh.getMasterTable().getTableRecords();
		Table lastTable = null;
		int tableCnt = 0;
		int indexCnt = 0;
		for (TableRecord tableRecord : tableRecords) {
			if (tableRecord.getIndexedColumn() < 0) {
				if (tableCnt > 0) {
					assertEquals(DBTestUtils.getIndexedColumnCount(tableCnt - 1), indexCnt);
				}
				String name = "TABLE" + tableCnt;
				lastTable = dbh.getTable(name);
				assertEquals(name, tableRecord.getName());
				assertEquals(Long.MIN_VALUE, tableRecord.getMaxKey());
				assertEquals(0, tableRecord.getRecordCount());
				assertEquals(-1, tableRecord.getRootBufferId());
				++tableCnt;
				indexCnt = 0;
			}
			else {
				if (lastTable == null) {
					Assert.fail();
				}
				int[] indexedColumns = DBTestUtils.getIndexedColumns(tableCnt - 1);
				assertTrue(indexCnt < indexedColumns.length);
				assertEquals(indexedColumns[indexCnt], tableRecord.getIndexedColumn());
				assertEquals(lastTable.getName(), tableRecord.getName());
				assertEquals(Long.MIN_VALUE, tableRecord.getMaxKey());
				assertEquals(0, tableRecord.getRecordCount());
				assertEquals(-1, tableRecord.getRootBufferId());
				++indexCnt;
			}

		}
		assertEquals(DBTestUtils.getIndexedColumnCount(tableCnt - 1), indexCnt);
		assertEquals(DBTestUtils.MAX_SCHEMA_TYPE + 1, tableCnt);

	}
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