boolean isCaught(@NotNull final PsiMethod method) {
      if (method.getUseScope() instanceof GlobalSearchScope) {
        final PsiSearchHelper searchHelper = PsiSearchHelper.getInstance(method.getProject());
        final PsiSearchHelper.SearchCostResult search = searchHelper.isCheapEnoughToSearch(method.getName(),
                                                                                           (GlobalSearchScope)method.getUseScope(),
                                                                                           null);
        if (search == PsiSearchHelper.SearchCostResult.ZERO_OCCURRENCES) return false;
        if (search == PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES) return true;
      }

      final Collection<PsiReference> references = ReferencesSearch.search(method).findAll();
      for (PsiReference reference : references) {
        if (!(reference instanceof PsiElement element)) continue;
        final PsiClass clazz = PsiTreeUtil.getParentOfType(element, PsiClass.class);
        final boolean catchSectionAbsent = PsiTreeUtil.treeWalkUp(element, clazz, new TryBlockCatchTypeProcessor(myType));
        if (!catchSectionAbsent) return true;
      }
      return false;
    }
boolean isCaught(@NotNull final PsiMethod method)