private String toString(List<?> list) {
		StringBuffer buffer = new StringBuffer("[ ");
		for (int i = 0; i < list.size(); i++) {
			buffer.append(markup(i, list.get(i).toString()));
			if (i + 1 < list.size()) {
				buffer.append(", ");
			}
		}

		buffer.append(" ]");
		return buffer.toString();
	}
A class that knows how to traverse a set a lines that are being used to generate a diff.
Ghidra/Features/Base/src/main/java/ghidra/app/util/html/diff/DiffLinesValidator.java