private void setupProgramOne() throws Exception {
		// delete all labels and comments over the range 0x31b through 0x0343
		Address min = addr(programOne, 0x31b);
		Address max = addr(programOne, 0x0343);

		int transactionID = programOne.startTransaction("test");
		programOne.getListing().clearComments(min, max);

		SymbolTable st = programOne.getSymbolTable();
		SymbolIterator iter = st.getSymbolIterator(min, true);
		while (iter.hasNext()) {
			Symbol symbol = iter.next();
			if (symbol.getAddress().compareTo(max) > 0) {
				break;
			}
			// cmd puts a dynamic label if there are references
			DeleteLabelCmd cmd = new DeleteLabelCmd(symbol.getAddress(), symbol.getName(),
				symbol.getParentNamespace());
			cmd.applyTo(programOne);
		}
		programOne.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