@Test
	public void testSaveAndLoad() throws IOException, VersionException, CancelledException {
		try (Transaction tid = trans()) {
			Table table = myDomainObject.storeFactory.getOrCreateTable(OBJECTS_TABLE_NAME,
				MyObject.class, false);
			assertEquals(0, table.getRecordCount());
			DBRecord record = table.getSchema().createRecord(0x1234);
			record.setLongValue(0, 0x811);
			record.setIntValue(1, 0x812);
			table.putRecord(record);
		}

		Path tmp = Files.createTempFile("test", ".db");
		Files.delete(tmp); // saveAs must create the file
		handle.saveAs(tmp.toFile(), false, new ConsoleTaskMonitor());
		DBHandle opened = new DBHandle(tmp.toFile());
		MyDomainObject restored = null;
		try {
			restored = new MyDomainObject(opened, OpenMode.IMMUTABLE, new ConsoleTaskMonitor(), 500,
				1000, this);
			MyObject rObj = restored.store.getObjectAt(0x1234);
			assertEquals(0x811, rObj.f1);
			assertEquals(0x812, rObj.f2);
		}
		finally {
			if (restored != null) {
				restored.release(this);
			}
		}
	}
This exists to verify behavior in {@link #testAsValuesSubIterator()}
Ghidra/Debug/ProposedUtils/src/test/java/ghidra/util/database/DBCachedObjectStoreTest.java