private void setupProgramTwo() throws Exception {
		Address min = addr(programTwo, 0x31b);
		Address max = addr(programTwo, 0x0343);
		Listing listing = programTwo.getListing();

		// create a function over the range 0x31b through 0x0343.
		int transactionID = programTwo.startTransaction("test");

		CreateFunctionCmd fnCmd =
			new CreateFunctionCmd(null, min, new AddressSet(min, max), SourceType.ANALYSIS);
		fnCmd.applyTo(programTwo);

		Function function = programTwo.getListing().getFunctionAt(min);

		// add a function comment.
		function.setComment("my function comment");
		// add some Plate, Pre, and Post comments within this function.
		CodeUnit cu = listing.getCodeUnitAt(addr(programTwo, 0x0320));
		cu.setComment(CommentType.PLATE, "My Plate Comment");
		cu.setComment(CommentType.POST, "My Post comment");

		cu = listing.getCodeUnitAt(addr(programTwo, 0x326));
		cu.setComment(CommentType.PLATE, "More Plate Comments (1)");
		cu.setComment(CommentType.POST, "More Post comments (1)");
		cu.setComment(CommentType.EOL, "More EOL comments (1)");

		cu = listing.getCodeUnitAt(addr(programTwo, 0x32a));
		cu.setComment(CommentType.PLATE, "More Plate Comments (2)");
		cu.setComment(CommentType.POST, "More Post comments (2)");
		cu.setComment(CommentType.EOL, "More EOL comments (2)");

		// Edit the label at 0x32d (RSR05) and make it part of a scope
		Symbol symbol = getUniqueSymbol(programTwo, "RSR05", null);

		assertNotNull(symbol);
		SymbolTable st2 = programTwo.getSymbolTable();
		Namespace ns = st2.createNameSpace(null, "MyNamespace", SourceType.USER_DEFINED);
		symbol.setNamespace(ns);

		programTwo.endTransaction(transactionID, true);
	}
Test the plugin that deals with cut/paste comments and labels
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/clipboard/CopyPasteCommentsTest.java