void (String initialText, int start, int end, String replacement) { CharSequence newText = StringUtil.replaceSubSequence(initialText, start, end, replacement); LineSet initial = LineSet.createLineSet(initialText); LineSet updated = initial.update(initialText, start, end, replacement, false); LineSet fresh = LineSet.createLineSet(newText); assertEquals("line count", fresh.getLineCount(), updated.getLineCount()); for (int i = 0; i < updated.getLineCount(); i++) { assertEquals("line start " + i, fresh.getLineStart(i), updated.getLineStart(i)); assertEquals("line end " + i, fresh.getLineEnd(i), updated.getLineEnd(i)); assertEquals("line feed length " + i, fresh.getSeparatorLength(i), updated.getSeparatorLength(i)); } }