@Test
	public void testRecoveryAfterMultiUndo() throws Exception {

		BufferMgr bufferMgr = null;
		BufferMgr bufferMgr2 = null;
		try {
			// Make sure we stress the RecoveryFile storage
			int bufferCnt = BUFFER_SIZE * 10;

			bufferMgr = init(bufferCnt, BUFFER_SIZE);

			bufferMgr.undo(true);
			bufferMgr.undo(true);
			bufferMgr.undo(true);
			bufferMgr.undo(true);

			assertTrue(bufferMgr.takeRecoverySnapshot(null, TaskMonitor.DUMMY));

			PrivateDatabase pdb = new PrivateDatabase(testDir);
			pdb.refresh();
			assertTrue(pdb.canRecover());

			// Leave first file open so that recovery files are not removed
			// Open a new instance to verify recovery

			LocalBufferFile bf2 = pdb.openBufferFileForUpdate();

			assertTrue(RecoveryMgr.canRecover(bf2));

			bufferMgr2 = new BufferMgr(bf2);

			assertTrue(bufferMgr2.recover(TaskMonitor.DUMMY));

			assertTrue(bufferMgr2.canSave());

			assertEquals(bufferCnt,
				bufferMgr2.getAllocatedBufferCount() + bufferMgr2.getFreeBufferCount());

			for (int i = 0; i < bufferCnt; i++) {
				DataBuffer buf = bufferMgr2.getBuffer(i);
				assertEquals(buf.getInt(0), -i);
				bufferMgr2.releaseBuffer(buf);
			}

		}
		finally {
			if (bufferMgr != null) {
				bufferMgr.dispose();
			}
			if (bufferMgr2 != null) {
				bufferMgr2.dispose();
			}
		}
	}
File created:
  bufferCnt buffers are filled with data, -bufferID stored at offset 0

Recovery snapshot taken after each transaction.
Transaction 1:
  growCnt buffers are added with data, -bufferID stored at offset 0
Transaction 2:
  all odd numbered buffers between 1 and bufferCnt-1 are deleted/freed
  +bufferID stored at offset 0 for buffers 0, 40, 80 ... <bufferCnt-1>
Transaction 3:
  +bufferID stored at offset 0 for buffers 20, 60, 100 ... <bufferCnt-1>
Transaction 4:
  +bufferID stored at offset 0 for buffers 10, 30, 50 ... <bufferCnt-1>

@param bufferCnt
@param growCnt
@return
@throws Exception
Ghidra/Framework/FileSystem/src/test.slow/java/db/buffers/RecoveryFileTest.java