@Test
	public void testRmiTargetDisconnectAction() throws Throwable {
		TraceObject proc1 = setUpRmiTarget();
		traceManager.activateObject(proc1);
		waitForSwing();
		assertFalse(rmiCx.isClosed());

		DockingAction actionTargetDisconnect = controlPlugin.actionTargetDisconnect;
		assertInTool(actionTargetDisconnect);
		performEnabledAction(null, actionTargetDisconnect, true);
		waitForTasks();

		assertTrue(rmiCx.isClosed());

		waitForPass(() -> assertFalse(actionTargetDisconnect.isEnabled()));
	}
Tests for target control and state editing

<p>
In these and other control service integration tests, we use {@link ControlMode#RW_EMULATOR} as a
stand-in for any mode. We also use {@link ControlMode#RO_TARGET} just to verify the mode is
heeded. Other modes may be tested if bugs crop up in various combinations.
Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/app/plugin/core/debug/gui/control/DebuggerControlPluginTest.java