@Override
  protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiElement element) {
    boolean available = element.getLanguage().isKindOf(JavaLanguage.INSTANCE) &&
                        PsiUtil.isAvailable(JavaFeature.TRY_WITH_RESOURCES, element) &&
                        (findVariable(element) != null || findExpression(element) != null);
    return available ? Presentation.of(getFamilyName()) : null;
  }
@Override
  protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiElement element)