boolean (SoftWrap newSoftWrap, int lengthDiff) { return Collections.binarySearch(myAffectedByUpdateSoftWraps, new SoftWrapImpl(new TextChangeImpl(newSoftWrap.getText(), newSoftWrap.getStart() - lengthDiff, newSoftWrap.getEnd() - lengthDiff), newSoftWrap.getIndentInColumns(), newSoftWrap.getIndentInPixels()), (o1, o2) -> { int offsetDiff = o1.getStart() - o2.getStart(); if (offsetDiff != 0) { return offsetDiff; } int textDiff = o1.getText().toString().compareTo(o2.getText().toString()); if (textDiff != 0) { return textDiff; } int colIndentDiff = o1.getIndentInColumns() - o2.getIndentInColumns(); if (colIndentDiff != 0) { return colIndentDiff; } return o1.getIndentInPixels() - o2.getIndentInPixels(); }) >= 0; }