@Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
    PsiElement element = getElement();
    if (element == null || isValidElement(element)) {
      return false;
    }

    int offset = editor.getCaretModel().getOffset();
    if (!isAvailableImpl(offset)) {
      return false;
    }

    List<PsiClass> targetClasses = filterTargetClasses(element, project);
    return !targetClasses.isEmpty();
  }
@Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file)