protected void chooseTargetClass(@NotNull Project project, @NotNull Editor editor, @NotNull Consumer<? super PsiClass> createInClass) {
    PsiElement element = getElement();
    List<PsiClass> targetClasses = filterTargetClasses(element, project);

    if (targetClasses.isEmpty()) return;

    if (targetClasses.size() == 1 || ApplicationManager.getApplication().isUnitTestMode()) {
      doInvoke(targetClasses.get(0), createInClass);
    } else {
      chooseTargetClass(targetClasses, editor, createInClass);
    }
  }
protected void chooseTargetClass(@NotNull Project project, @NotNull Editor editor, @NotNull Consumer<? super PsiClass> createInClass)