void () { PsiFile file = myFixture.addFileToProject("Foo.java", """ public abstract class Hello { { Runnable r = ()<caret> -> {}; } } """); myFixture.configureFromExistingVirtualFile(file.getVirtualFile()); final PsiElement element = TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.getInstance().getAllAccepted()); assertNull(element); }