void () { myFixture.addClass("@java.lang.annotation.Target(value={java.lang.annotation.ElementType.TYPE_USE}) @interface D {}"); final PsiJavaFile file = (PsiJavaFile)myFixture.addFileToProject("R.java", "public interface R {@D void run();}"); final PsiClass psiClass = file.getClasses()[0]; final PsiMethod method = psiClass.getMethods()[0]; assertNotSame(PsiTypes.voidType(), method.getReturnType()); myFixture.configureByText("a.java", "class A {{R r = () -> {};}} "); myFixture.checkHighlighting(false, false, false); }