void () { myFixture.configureByText("DumbAwareAnnotatorCheck.java", "class <error descr=\"null\">DumbAwareAnnotatorCheck</error> {}"); Language javaLanguage = JavaFileType.INSTANCE.getLanguage(); MyDumbAwareAnnotator dumbAwareAnnotator = new MyDumbAwareAnnotator(); LanguageAnnotators.INSTANCE.addExplicitExtension(javaLanguage, dumbAwareAnnotator); ((DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(getProject())).mustWaitForSmartMode(false, getTestRootDisposable()); try { DumbModeTestUtils.runInDumbModeSynchronously(getProject(), () -> { myFixture.testHighlighting(); }); } finally { LanguageAnnotators.INSTANCE.removeExplicitExtension(javaLanguage, dumbAwareAnnotator); } }