@Override
  protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiElement element) {
    if (!PsiUtil.isAvailable(JavaFeature.LVTI, context.file())) return null;
    PsiReferenceExpression reference = tryCast(element, PsiReferenceExpression.class);
    if (reference == null) return null;
    PsiLocalVariable variable = tryCast(reference.resolve(), PsiLocalVariable.class);
    if (variable == null) return null;
    PsiDeclarationStatement declarationStatement = tryCast(variable.getParent(), PsiDeclarationStatement.class);
    if (declarationStatement == null) return null;
    if (declarationStatement.getDeclaredElements().length != 1) return null;
    String name = variable.getName();

    PsiType type = variable.getType();
    if (!PsiTypesUtil.isDenotableType(type, variable)) {
      return null;
    }
    return Presentation.of(QuickFixBundle.message("convert.variable.to.field.in.anonymous.class.fix.name", name));
  }
@Override
  protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiElement element)