Collections.addAll(lines, LineTokenizer.tokenize(text, false));
ApplyPatchStatus result = null;
for(PatchHunk hunk: myHunks) {
result = ApplyPatchStatus.and(result, hunk.apply(lines));
}
<BUG>for(String line: lines) {
newText.append(line).append("\n");
}</BUG>
return result;
}

Collections.addAll(lines, LineTokenizer.tokenize(text, false));
ApplyPatchStatus result = null;
for(PatchHunk hunk: myHunks) {
result = ApplyPatchStatus.and(result, hunk.apply(lines));
}
for(int i=0; i<lines.size(); i++) {
newText.append(lines.get(i));
if (i < lines.size()-1 || !myHunks.get(myHunks.size()-1).isNoNewLineAtEnd()) {
newText.append("\n");
}
}
return result;
}
