List<LineFragment> (@NotNull List<LineFragment> oldFragments, @NotNull final CharSequence text1, @NotNull final CharSequence text2, @NotNull final ComparisonPolicy policy, final boolean squash, final boolean trim) { if (!squash && !trim) return oldFragments; if (oldFragments.isEmpty()) return oldFragments; final List<LineFragment> newFragments = new ArrayList<>(); processAdjoining(oldFragments, fragments -> newFragments.addAll(processAdjoining(fragments, text1, text2, policy, squash, trim))); return newFragments; }