List<DiffFragment> (@NotNull CharSequence text1, @NotNull CharSequence text2, @NotNull ComparisonPolicy policy, @NotNull ProgressIndicator indicator) { DiffIterable iterable; if (policy == ComparisonPolicy.DEFAULT) { iterable = ByCharRt.compareTwoStep(text1, text2, new IndicatorCancellationChecker(indicator)); } else if (policy == ComparisonPolicy.TRIM_WHITESPACES) { iterable = ByCharRt.compareTrimWhitespaces(text1, text2, new IndicatorCancellationChecker(indicator)); } else { iterable = ByCharRt.compareIgnoreWhitespaces(text1, text2, new IndicatorCancellationChecker(indicator)); } return ByWordRt.convertIntoDiffFragments(iterable); }