UnifiedFragmentBuilder () { if (myFragments.isEmpty()) { appendTextMaster(0, 0, getLineCount(myDocument1) - 1, getLineCount(myDocument2) - 1); return this; } for (int i = 0; i < myFragments.size(); i++) { LineFragment fragment = myFragments.get(i); processEquals(fragment.getStartLine1() - 1, fragment.getStartLine2() - 1); processChanged(fragment, i); } processEquals(getLineCount(myDocument1) - 1, getLineCount(myDocument2) - 1); return this; }