public static @Nullable LineSeparator detectLineSeparators(@Nullable Document document, @Nullable String text) {
    if (text == null) return null;
    boolean doNotNormalizeDetect = document instanceof DocumentImpl && ((DocumentImpl)document).acceptsSlashR();
    if (doNotNormalizeDetect) return null;
    return StringUtil.detectSeparators(text);
  }
public static @Nullable LineSeparator detectLineSeparators(@Nullable Document document, @Nullable String text)