List<MergeRange> (@NotNull CharSequence text1, @NotNull CharSequence text2, @NotNull CharSequence text3, @NotNull List<? extends MergeRange> conflicts, @NotNull ComparisonPolicy policy, @NotNull CancellationChecker indicator) { switch (policy) { case DEFAULT: return new MergeDefaultCorrector(conflicts, text1, text2, text3, indicator).build(); case TRIM_WHITESPACES: List<MergeRange> defaultConflicts = new MergeDefaultCorrector(conflicts, text1, text2, text3, indicator).build(); return new MergeTrimSpacesCorrector(defaultConflicts, text1, text2, text3, indicator).build(); case IGNORE_WHITESPACES: return new MergeIgnoreSpacesCorrector(conflicts, text1, text2, text3, indicator).build(); default: throw new IllegalArgumentException(policy.name()); } }