@Test
	public void testPasteActionEnablement() {

		DockingAction byteViewerCopyAction =
			getAction(byteViewerClipboardProvider, COPY_ACTION_NAME);
		DockingAction codeBrowserCopyAction =
			getAction(codeBrowserClipboardProvider, COPY_ACTION_NAME);
		DockingAction decompileCopyAction = getAction(decompileClipboardProvider, COPY_ACTION_NAME);

		// no paste on by default
		DockingAction byteViewerPasteAction =
			getAction(byteViewerClipboardProvider, PASTE_ACTION_NAME);
		DockingAction codeBrowserPasteAction =
			getAction(codeBrowserClipboardProvider, PASTE_ACTION_NAME);

		assertFalse(byteViewerPasteAction.isEnabled());
		assertFalse(codeBrowserPasteAction.isEnabled());

		// For each provider make sure no paste on a selection without a copy:
		// check copy on selection state
		makeSelection(byteViewerWrapper);

		// check the state
		assertFalse(byteViewerPasteAction.isEnabled());

		// clear the selection
		byteViewerWrapper.clearSelection();

		// check copy on selection state
		codeViewerWrapper.clearSelection();

		// check the state
		assertFalse(codeBrowserPasteAction.isEnabled());

		// clear the selection
		codeViewerWrapper.clearSelection();

		// check copy on selection state
		makeSelection(decompilerWrapper);

		// clear the selection
		decompilerWrapper.clearSelection();

		// For each provider make sure paste on a selection after a copy:
		// check paste on selection state
		makeSelection(byteViewerWrapper);
		copy(byteViewerWrapper, byteViewerCopyAction);

		// check the state
		assertFalse(byteViewerPasteAction.isEnabled());
		setByteViewerEditable(true);
		assertTrue(byteViewerPasteAction.isEnabled());

		// clear the selection and clipboard
		byteViewerWrapper.clearSelection();
		clearClipboardContents();

		makeSelection(codeViewerWrapper);

		copy(codeViewerWrapper, codeBrowserCopyAction);

// TODO: if we ever find a way to prevent the paste action from being enabled without
// actually doing the paste, then the following line of code can be put back in the test
// check the state - can't paste a generic copy!
//assertTrue( !codeBrowserPasteAction.isEnabled() );

		// now perform a 'copy special' and choose a type that the paste will accept
		DockingAction codeBrowserCopySpecialAction =
			getAction(codeBrowserClipboardProvider, COPY_SPECIAL_ACTION_NAME);
		assertTrue(codeBrowserCopySpecialAction.isEnabled());
		copySpecial(codeViewerWrapper, codeBrowserCopySpecialAction);

		assertTrue(codeBrowserPasteAction.isEnabled());

		// clear the selection and clipboard
		codeViewerWrapper.clearSelection();
		clearClipboardContents();

		// check copy on selection state
		makeSelection(decompilerWrapper);
		copy(decompilerWrapper, decompileCopyAction);

		// clear the selection and clipboard
		decompilerWrapper.clearSelection();
		clearClipboardContents();
	}
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