void () { final JavaPsiFacadeEx psiManager = getJavaFacade(); final PsiElementFactory factory = psiManager.getElementFactory(); final PsiClass classA = psiManager.findClass("A"); assertNotNull(classA); final PsiTypeParameter parameterT = classA.getTypeParameters()[0]; assertEquals("T", parameterT.getName()); final PsiMethod method = classA.findMethodsByName("method", false)[0]; final PsiType type = ((PsiExpressionStatement) method.getBody().getStatements()[0]).getExpression().getType(); final PsiClassType typeT = factory.createType(parameterT); assertEquals("T", typeT.getPresentableText()); assertEquals(typeT, type); }