void (final T context, final Editor editor, PsiFile file, final Project project) { PsiClass selectedClass; if (!ApplicationManager.getApplication().isUnitTestMode()) { PsiClass baseClass = getBaseClass(context, project, myBaseClass); TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project) .createInheritanceClassChooser(getChooserTitle(), GlobalSearchScope.allScope(project), baseClass, null, new ClassFilter() { @Override public boolean isAccepted(PsiClass aClass) { return !aClass.isInterface() && !aClass.hasModifierProperty(PsiModifier.ABSTRACT); } }); chooser.showDialog(); selectedClass = chooser.getSelected(); } else { selectedClass = getBaseClass(context, project, myBaseClass == null ? CommonClassNames.JAVA_LANG_OBJECT : myBaseClass); } if (selectedClass == null) return; createElement(context, editor, file, project, selectedClass); }