private void setComment(MemoryBlock block, String aValue) {

		String cmt = block.getComment();
		if (cmt == null || !cmt.equals(aValue)) {
			if (aValue.length() == 0) {
				aValue = null;
			}

			String newValue = aValue;
			program.withTransaction("Set Comment", () -> {
				block.setComment(newValue);
			});
		}
	}
Table Model for a Table where each entry represents a MemoryBlock from a Program's Memory.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/MemoryMapModel.java