void () { myFixture.addClass("class Foo extends Exception {}"); myFixture.addClass("class Bar {}"); PsiClass aClass = JavaPsiFacade.getInstance(getProject()).findClass(CommonClassNames.JAVA_LANG_EXCEPTION, GlobalSearchScope.allScope(getProject())); final Ref<ChooseByNameModel> ref = new Ref<>(); TreeJavaClassChooserDialog dialog = new TreeJavaClassChooserDialog("hey", getProject(), GlobalSearchScope.projectScope(getProject()), null, aClass, null, false) { @Override protected ChooseByNameModel createChooseByNameModel() { ChooseByNameModel model = super.createChooseByNameModel(); ref.set(model); return model; } @Override public JRootPane getRootPane() { return new JRootPane(); } }; Disposer.register(myFixture.getTestRootDisposable(), dialog.getDisposable()); ChooseByNameModelEx model = (ChooseByNameModelEx)ref.get(); CommonProcessors.CollectProcessor<String> processor = new CommonProcessors.CollectProcessor<>(); model.processNames(processor, FindSymbolParameters.simple(getProject(), false)); List<String> results = (List<String>)processor.getResults(); assertEquals(1, results.size()); }