void () { myFixture.configureByText("a.java", """ import java.util.List; abstract class Test { abstract <R, K> R foo(K k1, K k2); { String str = ""; List<String> l = f<caret>oo(foo(str, str), str); } } """); final PsiElement elementAtCaret = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); Assert.assertTrue(elementAtCaret instanceof PsiIdentifier); final PsiElement refExpr = elementAtCaret.getParent(); Assert.assertTrue(refExpr.toString(), refExpr instanceof PsiExpression); final PsiType type = ((PsiExpression)refExpr).getType(); Assert.assertNotNull(refExpr.toString(), type); Assert.assertTrue(type.getCanonicalText(), type.equalsToText("java.util.List<java.lang.String>")); }