@Test
	public void testCodeBrowser_CopyFromComment_PasteToComment() throws Exception {
		//
		// Test that we can copy (simulating the keyboard action) from one comment and then
		// paste onto another comment.
		//

		PlateFieldLocation plateFieldLocation =
			new PlateFieldLocation(program, addr("0100415a"), null, 1, 10, new String[] { "" }, 0);

		codeBrowserPlugin.goTo(plateFieldLocation);

		ProgramLocation currentLocation = codeBrowserPlugin.getCurrentLocation();
		assertTrue(currentLocation instanceof PlateFieldLocation);
		plateFieldLocation = (PlateFieldLocation) currentLocation;
		String commentText = plateFieldLocation.getComment()[1];
		assertEquals(
			";|||||||||||||||||||| FUNCTION ||||||||||||||||||||||||||||||||||||||||||||||||||",
			commentText);

		assertTrue(codeBrowserClipboardProvider.canCopy());

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

		// 3)
		// 0100415a PreCommentFieldLocation
		CommentFieldLocation commentFieldLocation = new CommentFieldLocation(program,
			addr("0100415a"), null, new String[] { "" }, CommentType.PRE, 5, 10);

		codeBrowserPlugin.goTo(plateFieldLocation);

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

		currentLocation = codeBrowserPlugin.getCurrentLocation();
		assertTrue(currentLocation instanceof CommentFieldLocation);
		commentFieldLocation = (CommentFieldLocation) currentLocation;
		String[] comments = commentFieldLocation.getComment();
		assertEquals(2, comments.length);
		assertEquals(commentText, comments[0]);
	}
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