String () { final StringBuilder sb = new StringBuilder(); // put not bind into the beginning for (SplitHunk hunk : myNotBound) { linesToSb(sb, hunk.getAfterAll(), true); } iterateTransformations(range -> { List<String> baseLinesList = myLines.subList(range.getStartOffset(), range.getEndOffset() + 1); boolean withLineBreak = !containsLastLine(range) || myBaseFileEndsWithNewLine; linesToSb(sb, baseLinesList, withLineBreak); }, range -> { final MyAppliedData appliedData = myTransformations.get(range); List<String> list = appliedData.getList(); boolean withLineBreak = !containsLastLine(range) || !mySuppressNewLineInEnd; linesToSb(sb, list, withLineBreak); }); return sb.toString(); }