private void copySpecial(ComponentProviderWrapper wrapper, final DockingAction copyAction) {

		executeOnSwingWithoutBlocking(() -> copyAction.actionPerformed(getActionContext(wrapper)));

		// get the dialog and make a selection
		JDialog dialog = waitForJDialog("Copy Special");
		assertNotNull(dialog);
		DockingDialog dockingDialog = (DockingDialog) dialog;
		final DialogComponentProvider component =
			(DialogComponentProvider) getInstanceField("component", dockingDialog);
		Object listPanel = getInstanceField("listPanel", component);
		final JList<?> list = (JList<?>) getInstanceField("list", listPanel);

		runSwing(() -> {
			list.setSelectedValue(ByteCopier.BYTE_STRING_TYPE, true);
			JButton okButton = (JButton) getInstanceField("okButton", component);
			okButton.doClick();
		});

		waitForTasks();
	}
Note: This test is sensitive to focus. So, don't click any windows while this test is running.
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/app/plugin/core/clipboard/ClipboardPluginTest.java