@Override
  public @Nullable Presentation getPresentation(@NotNull ActionContext actionContext) {
    if (!BaseIntentionAction.canModify(actionContext.file())) return null;
    PsiElement element = actionContext.findLeaf();
    List<ExpressionToConstantComparison> comparisons = comparisons(element).toList();
    if (comparisons.size() <= 1) return null;
    return switch (myProcessDuplicates) {
      case UNSURE -> Presentation.of(getFamilyName());
      case YES -> {
        PsiClass containingClass = ClassUtils.getContainingStaticClass(element);
        if (containingClass == null) yield null;
        ExpressionToConstantReplacementContext context = new ExpressionToConstantReplacementContext(comparisons);
        List<ExpressionToConstantReplacementContext> copies = findCopies(comparisons, containingClass);
        TextRange[] ranges =
          StreamEx.of(copies).append(context).map(ExpressionToConstantReplacementContext::range).toArray(TextRange.EMPTY_ARRAY);
        yield Presentation.of(JavaBundle.message("intention.extract.set.from.comparison.chain.replace.all")).withHighlighting(ranges);
      }
      case NO -> {
        ExpressionToConstantReplacementContext context = new ExpressionToConstantReplacementContext(comparisons);
        yield Presentation.of(JavaBundle.message("intention.extract.set.from.comparison.chain.replace.only.this"))
          .withHighlighting(context.range());
      }
    };
  }
@Override
  public @Nullable Presentation getPresentation(@NotNull ActionContext actionContext)