void () { final JavaPsiFacade manager = getJavaFacade(); final PsiExpression psiExpression = manager.getElementFactory().createExpressionFromText("List", null); final PsiClass classTestList = manager.findClass("test.List", GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(myModule)); assertNotNull(classTestList); final PsiElement result = ((PsiReferenceExpression) psiExpression).bindToElement(classTestList); assertEquals("test.List", result.getText()); }