@Override
  public boolean pointsToTheSameElementAs(@NotNull final SmartPointerElementInfo other) {
    if (other instanceof SelfElementInfo) {
      SelfElementInfo otherInfo = (SelfElementInfo) other;
      if (!getVirtualFile().equals(other.getVirtualFile()) || myType != otherInfo.myType)
        return false;

      Segment range1 = getPsiRange();
      Segment range2 = otherInfo.getPsiRange();
      return range1 != null
          && range2 != null
          && range1.getStartOffset() == range2.getStartOffset()
          && range1.getEndOffset() == range2.getEndOffset();
    }
    return areRestoredElementsEqual(other);
  }
 @Override
 public void fastenBelt(int offset, RangeMarker[] cachedRangeMarker) {
   if (getStubId() != -1) {
     switchToTree();
   }
   super.fastenBelt(offset, cachedRangeMarker);
 }