@Override
    public void visitClass(@NotNull PsiClass aClass) {
      if (ReferencesSearch.search(aClass, new LocalSearchScope(myParent))
        .anyMatch(ref -> !isInside(ref.getElement()))) {
        addSideEffect();
      }
      // local or anonymous class declaration is not side effect per se (unless referenced from outside of block)
    }
@Override
    public void visitClass(@NotNull PsiClass aClass)