private void validateState(DocumentEvent e, int oldStart, int oldEnd) {
    if (myHighlighter.isValid()) {
      if (!isValid()) {
        reportError("Base highlighter " + myHighlighter + " is valid, mirror " +
                    this + "(prev state: " + oldStart + "-" + oldEnd + ") is invalid after " + e);
      }
      else if (intervalStart() != myHighlighter.getStartOffset() || intervalEnd() != myHighlighter.getEndOffset()) {
        String extendedHighlighterInfo = "";
        if (myHighlighter instanceof PersistentRangeHighlighterImpl h) {
          extendedHighlighterInfo = "(prev state: " + h.prevStartOffset + "-" + h.prevEndOffset + ", stamps match: " +
                                    (h.modificationStamp == (byte)e.getDocument().getModificationStamp()) + ")";
        }
        reportError("Mirror highlighter " + this + "(prev state: " + oldStart + "-" + oldEnd +
                    ") diverged from base one " + myHighlighter + extendedHighlighterInfo + " after " + e);
        setRange(TextRangeScalarUtil.toScalarRange(myHighlighter));
      }
    }
    else if (isValid()) {
      reportError("Base highlighter " + myHighlighter + " is invalid, mirror " + this + "(prev state: " + oldStart + "-" + oldEnd +
                  ") is valid after " + e);
      invalidate();
    }
  }
private void validateState(DocumentEvent e, int oldStart, int oldEnd)