private void breakConnectionsFromRedundantExceptions(final @NotNull Set<? extends PsiClassType> redundantTypes,
                                                           final @NotNull PsiMethod method) {
        for (final @NotNull PsiCatchSection catchSection : catchToExceptionTypes.keySet()) {
          for (final @NotNull PsiType exception : catchToExceptionTypes.get(catchSection)) {
            if (!ContainerUtil.exists(redundantTypes, exception::isAssignableFrom)) continue;

            final Iterator<@NotNull PsiElement> catchTypeInducers = getExceptionInducers(exception).iterator();
            while (catchTypeInducers.hasNext()) {
              final @NotNull PsiElement callInducer = catchTypeInducers.next();

              if (!(callInducer instanceof PsiCall)) continue;

              final JavaResolveResult result = PsiDiamondType.getDiamondsAwareResolveResult((PsiCall)callInducer);
              final PsiElement element = result.getElement();
              final PsiMethod resolvedMethod = element instanceof PsiMethod ? (PsiMethod)element : null;

              if (resolvedMethod == method) catchTypeInducers.remove();
            }
          }
        }
      }
private void breakConnectionsFromRedundantExceptions(final @NotNull Set<? extends PsiClassType> redundantTypes,
                                                           final @NotNull PsiMethod method)