void () { PsiReferenceExpression ref = configure(); JavaResolveResult resolveResult = ref.advancedResolve(false); PsiSubstitutor substitutor = resolveResult.getSubstitutor(); PsiMethod method = (PsiMethod)resolveResult.getElement(); PsiType type = substitutor.substitute(method.getTypeParameters()[0]); assertEquals("java.lang.String", type.getCanonicalText()); }