private static @Nullable String getLineText(@NotNull Document document, int line) {
    if (line > 0 && line < document.getLineCount()) {
      return document.getText(TextRange.create(document.getLineStartOffset(line), document.getLineEndOffset(line)));
    }
    return null;
  }
private static @Nullable String getLineText(@NotNull Document document, int line)