public static void processMethod(@NotNull Project project,
                                   @NotNull PsiMethod targetMethod,
                                   @NotNull Set<? extends PsiClassType> unhandledExceptions) throws IncorrectOperationException {
    for (PsiClassType unhandledException : unhandledExceptions) {
      PsiClass exceptionClass = unhandledException.resolve();
      if (exceptionClass != null) {
        PsiUtil.addException(targetMethod, exceptionClass);
      }
    }

    CodeStyleManager.getInstance(project).reformat(targetMethod.getThrowsList());
  }
public static void processMethod(@NotNull Project project,
                                   @NotNull PsiMethod targetMethod,
                                   @NotNull Set<? extends PsiClassType> unhandledExceptions)