void () { final PsiClass baseClass = myJavaFacade.findClass("pack.GenericClass", GlobalSearchScope.moduleScope(myModule)); assertNotNull(baseClass); final PsiMethod method = baseClass.getMethods()[0]; PsiReference[] references = MethodReferencesSearch.search(method, GlobalSearchScope.moduleScope(myModule), false).toArray(PsiReference.EMPTY_ARRAY); assertEquals(1, references.length); final PsiElement element = references[0].getElement(); final PsiClass refClass = PsiTreeUtil.getParentOfType(element, PsiClass.class); assertEquals(refClass.getName(), "GenericClassDerived"); }