boolean (final String barText) { myFixture.configureByText("Foo.java", "import java.util.*;" + "class Foo {" + " <T> T foo(T t, List<T> lT) {" + " }" + barText + "}"); final PsiElement elementAtCaret = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); assertNotNull(elementAtCaret); final PsiExpression psiExpression = PsiTreeUtil.getParentOfType(elementAtCaret, PsiExpression.class); assertInstanceOf(psiExpression, PsiLambdaExpression.class); final PsiClass aClass = myFixture.findClass("Foo"); assertNotNull(aClass); final PsiMethod[] meths = aClass.findMethodsByName("foo", false); assertEquals(1, meths.length); return InferenceSession.isPertinentToApplicability(psiExpression, meths[0]); }