private static int compareByHighlightInfoSeverity(@NotNull RangeHighlighterEx o1, @NotNull RangeHighlighterEx o2) {
    HighlightInfo info1 = HighlightInfo.fromRangeHighlighter(o1);
    HighlightInfo info2 = HighlightInfo.fromRangeHighlighter(o2);
    HighlightSeverity severity1 = info1 == null ? null : info1.getSeverity();
    HighlightSeverity severity2 = info2 == null ? null : info2.getSeverity();
    if (severity1 != null && severity2 != null) {
      // higher severity should win
      return severity2.compareTo(severity1);
    }
    // having severity has more priority than no severity
    return Boolean.compare(severity1 == null, severity2 == null);
  }
private static int compareByHighlightInfoSeverity(@NotNull RangeHighlighterEx o1, @NotNull RangeHighlighterEx o2)