private Program buildProgram(String name) throws Exception {
		ToyProgramBuilder builder = new ToyProgramBuilder(name, true, ProgramBuilder._TOY);
		builder.createMemory("test1", "0x0000", 0x2000);
		builder.createLabel("0x32d", "RSR05");
		builder.createLabel("0x331", "RSR10");
		builder.createLabel("0x31b", "RSTOR()");

		builder.addBytesFallthrough("0x0326");
		builder.createComment("0x0326", "Hey There", CommentType.EOL);
		builder.createComment("0x0182", "SAVE register 'I'", CommentType.EOL);
		builder.createComment("0x0334", "Set the SP to RAM:ESAV", CommentType.EOL);
		builder.createComment("0x0335", "RESTORE register 'DE'", CommentType.EOL);
		builder.createComment("0x0336", "RESTORE register 'BC'", CommentType.EOL);
		builder.createComment("0x0337", "RESTORE register 'A' and FLAGS", CommentType.EOL);
		builder.createComment("0x0338", "RESTORE register 'SP'", CommentType.EOL);

		builder.createMemoryReference("0x1000", "0x331", RefType.UNCONDITIONAL_JUMP,
			SourceType.DEFAULT);
		builder.createMemoryReference("0x1000", "0x31b", RefType.UNCONDITIONAL_JUMP,
			SourceType.DEFAULT);

		return builder.getProgram();
	}
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