}
private String applyChanges(String content, List<?> changes) {
StringBuffer result = new StringBuffer(content);
for (int i = changes.size() - 1; i >= 0; i--) {
ReplaceEdit replace = (ReplaceEdit) changes.get(i);
result = result.replace(replace.offset, replace.getEnd(),
replace.content);
}
return result.toString();
}