@Test
	public void testCodeBrowser_CopyFromOperandReference_PasteToLabel_Notepad() throws Exception {
		//
		// Test that we can copy (simulating the keyboard action) from an operand reference
		// label and then paste onto another label.  This is useful for copying across
		// programs, as doing so in the same program will fail due to a name
		// collision.

		// So, we have to perform the following steps to test the code:
		// 1) Put the cursor on an operand and execute the copy command (to get the name on the clipboard)
		// 2) Name that operand's label to a custom name
		// 3) Put the cursor on a different label and execute the paste command
		//

		// 1)
		String operandText = "dword ptr [->ADVAPI32.dll::RegQueryValueExW]";
		OperandFieldLocation operandFieldLocation = new OperandFieldLocation(program,
			addr("0100418c"), null, addr("01001008"), operandText, 15, 0);
		codeBrowserPlugin.goTo(operandFieldLocation);

		ProgramLocation currentLocation = codeBrowserPlugin.getCurrentLocation();
		assertTrue(currentLocation instanceof OperandFieldLocation);
		operandFieldLocation = (OperandFieldLocation) currentLocation;
		assertEquals(operandText, operandFieldLocation.getOperandRepresentation());

		assertTrue(codeBrowserClipboardProvider.canCopy());

		DockingAction copyAction = getAction(codeBrowserClipboardProvider, COPY_ACTION_NAME);
		ActionContext context = codeViewerProvider.getActionContext(null);
		performAction(copyAction, context, true);

		// 2)
		String oldLabelName = "ADVAPI32.dll_RegQueryValueExW";
		LabelFieldLocation renameLabelLocation =
			new LabelFieldLocation(program, addr("01001008"), oldLabelName, null, 0);
		codeBrowserPlugin.goTo(renameLabelLocation);

		String newLabelName = "BigBuddyBob";
		renameLabel(renameLabelLocation, oldLabelName, newLabelName);

		// 3)
		String oldPasteName = "LAB_01002cf0";
		LabelFieldLocation pasteLabelLocation =
			new LabelFieldLocation(program, addr("01002cf0"), oldPasteName, null, 0);
		assertTrue(
			codeBrowserPlugin.goToField(addr("01002cf0"), LabelFieldFactory.FIELD_NAME, 0, 0));

		DockingAction pasteAction = getAction(codeBrowserClipboardProvider, PASTE_ACTION_NAME);
		context = codeViewerProvider.getActionContext(null);
		performAction(pasteAction, context, true);
		waitForBusyTool(tool);

		currentLocation = codeBrowserPlugin.getCurrentLocation();
		assertTrue(currentLocation instanceof LabelFieldLocation);
		pasteLabelLocation = (LabelFieldLocation) currentLocation;
		assertEquals(oldLabelName, pasteLabelLocation.getName());
	}
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