@Nullable
  private static HighlighterIterator createIteratorAndCheckNotAtEnd(@NotNull Editor editor, int offset) {
    HighlighterIterator iterator = editor.getHighlighter().createIterator(offset);
    if (iterator.atEnd()) {
      LOG.error("Iterator " + iterator + " ended unexpectedly right after creation");
      return null;
    }
    return iterator;
  }
@Nullable
  private static HighlighterIterator createIteratorAndCheckNotAtEnd(@NotNull Editor editor, int offset)