DiffIterable (@NotNull CharSequence text1, @NotNull CharSequence text2, @NotNull FairDiffIterable iterable, @NotNull ComparisonPolicy policy, @NotNull CancellationChecker indicator) { switch (policy) { case DEFAULT: return new DefaultCorrector(iterable, text1, text2, indicator).build(); case TRIM_WHITESPACES: DiffIterable defaultIterable = new DefaultCorrector(iterable, text1, text2, indicator).build(); return new TrimSpacesCorrector(defaultIterable, text1, text2, indicator).build(); case IGNORE_WHITESPACES: return new IgnoreSpacesCorrector(iterable, text1, text2, indicator).build(); default: throw new IllegalArgumentException(policy.name()); } }