@Test
	public void testUndoHijack() throws Exception {

		// check out a file
		GTreeNode node = getNode(PROGRAM_A);
		addToVersionControl(node, false);

		selectNode(node);
		final DockingActionIf action = getAction("CheckOut");
		SwingUtilities.invokeLater(() -> action.actionPerformed(getDomainFileActionContext(node)));
		waitForSwing();

		waitForTasks();

		DockingActionIf undoHijackAction = getAction("Undo Hijack");
		assertTrue(!undoHijackAction.isEnabledForContext(getDomainFileActionContext(node)));

		// make a change to the program
		DomainFile df = ((DomainFileNode) node).getDomainFile();
		Program program = (Program) df.getDomainObject(this, true, false, TaskMonitor.DUMMY);
		int transactionID = program.startTransaction("test");
		try {
			program.getSymbolTable().createNameSpace(null, "myNamespace", SourceType.USER_DEFINED);
		}
		finally {
			program.endTransaction(transactionID, true);
			program.save(null, TaskMonitor.DUMMY);
		}
		program.release(this);
		program.flushEvents();

		// terminate the checkout to get a hijacked file
		ItemCheckoutStatus[] items = df.getCheckouts();
		assertEquals(1, items.length);
		df.terminateCheckout(items[0].getCheckoutId());
		waitForSwing();

		clearSelectionPaths();

		selectNode(node);
		assertTrue(undoHijackAction.isEnabledForContext(getDomainFileActionContext(node)));
		waitForSwing();

		// undo the hijack		
		performFrontEndAction(undoHijackAction);
		UndoActionDialog dialog = waitForDialogComponent(UndoActionDialog.class);
		assertNotNull(dialog);

		DomainFilesPanel panel = findComponent(dialog.getComponent(), DomainFilesPanel.class);
		assertNotNull(panel);

		DomainFile[] files = panel.getSelectedDomainFiles();
		assertEquals(1, files.length);
		assertEquals(df, files[0]);

		assertTrue(dialog.saveCopy());
		pressButtonByText(dialog.getComponent(), "OK");

		waitForSwing();
		waitForTasks();

		assertNotNull(getNode(PROGRAM_A + ".keep"));
		assertTrue(!undoHijackAction.isEnabledForContext(getDomainFileActionContext(node)));
	}
Tests for version control (not multi user).
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/datatree/VersionControlAction1Test.java