private @NotNull List<PsiMethod> changeReturnType(PsiMethod method, @NotNull PsiType returnType) {
    PsiMethod[] methods = new PsiMethod[] {method};
    if (myFixWholeHierarchy) {
      PsiType type = getHierarchyAdjustedReturnType(method, returnType);
      if (type != null) {
        returnType = type;
      }
      else {
        final PsiMethod[] superMethods = method.findDeepestSuperMethods();
        if (superMethods.length > 0) {
          methods = superMethods;
        }
      }
    }

    Project project = method.getProject();
    final List<PsiMethod> affectedMethods = new ArrayList<>();
    for (PsiMethod targetMethod : methods) {
      affectedMethods.add(targetMethod);
      var processor = JavaRefactoringFactory.getInstance(project).createChangeSignatureProcessor(targetMethod,
                                                                         false, null,
                                                                         myName,
                                                                         returnType,
                                                                         ParameterInfoImpl.fromMethod(targetMethod),
                                                                         null, null, null, null);
      processor.run();
    }

    PsiMethod[] hierarchyMethods = methods;
    if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
      for (PsiMethod psiMethod : hierarchyMethods) {
        OverridingMethodsSearch.search(psiMethod).forEach(m -> {
          affectedMethods.add(m);
        });
      }
    }, JavaBundle.message("progress.title.collect.method.overriders"), true, project)) {
      return Collections.emptyList();
    }
    return affectedMethods;
  }
private @NotNull List<PsiMethod> changeReturnType(PsiMethod method, @NotNull PsiType returnType)