@Override
  protected @NotNull ModCommand perform(@NotNull ActionContext context, @NotNull PsiMethod method) {
    if (!method.hasModifierProperty(PsiModifier.PRIVATE)) return ModCommand.nop();
    List<PsiElement> elements;
    if (myDeleteCalled == ThreeState.NO) {
      elements = List.of();
    }
    else {
      Set<PsiElement> finalElements = new HashSet<>();
      Deque<PsiMethod> toProcess = new ArrayDeque<>();
      toProcess.add(method);
      finalElements.add(method);
      while (!toProcess.isEmpty()) {
        PsiMethod next = toProcess.poll();
        List<PsiMethod> newMethods = ContainerUtil.filterIsInstance(SafeDeleteFix.computeReferencedCodeSafeToDelete(
          next, t -> t instanceof PsiMethod m && m.hasModifierProperty(PsiModifier.PRIVATE)), PsiMethod.class);
        for (PsiMethod newMethod : newMethods) {
          if (finalElements.add(newMethod)) {
            toProcess.add(newMethod);
          }
        }
      }
      elements = List.copyOf(finalElements);
    }
    if (elements.isEmpty()) {
      return ModCommand.psiUpdate(method, m -> m.delete());
    }
    if (myDeleteCalled == ThreeState.UNSURE) {
      return ModCommand.chooseAction(JavaBundle.message("intention.name.delete.method.title", method.getName()),
                                     new DeletePrivateMethodFix(method, ThreeState.YES),
                                     new DeletePrivateMethodFix(method, ThreeState.NO));
    }
    return ModCommand.psiUpdate(method, (m, updater) -> {
      List<PsiElement> writable = ContainerUtil.map(elements, updater::getWritable);
      writable.forEach(PsiElement::delete);
      m.delete();
    });
  }
@Override
  protected @NotNull ModCommand perform(@NotNull ActionContext context, @NotNull PsiMethod method)