void () { setupLoadingFilter(); PsiClass cloneableClass = myJavaFacade.findClass("java.lang.Cloneable", GlobalSearchScope.allScope(myProject)); PsiClass[] inheritors = ClassInheritorsSearch.search(cloneableClass, GlobalSearchScope.projectScope(myProject), true).toArray(PsiClass.EMPTY_ARRAY); assertEquals(2, inheritors.length); assertTrue(inheritors[0] instanceof PsiAnonymousClass || inheritors[1] instanceof PsiAnonymousClass); PsiAnonymousClass anonClass = (PsiAnonymousClass)(inheritors[0] instanceof PsiAnonymousClass ? inheritors[0] : inheritors[1]); PsiClassType baseClassRef = anonClass.getBaseClassType(); assertEquals("Cloneable", baseClassRef.getPresentableText()); assertEquals(cloneableClass, baseClassRef.resolve()); assertEquals("java.lang.Cloneable", baseClassRef.getCanonicalText()); teardownLoadingFilter(); assertTrue(anonClass.getParent() instanceof PsiNewExpression); }