void () { assertNotNull(JavaPsiFacade.getInstance(getProject()).findClass("java.util.ArrayList", GlobalSearchScope.allScope(getProject()))); @Language("JAVA") @NonNls String text = "class S { /*ArrayList l; HashMap h; <caret>*/ }"; configureByText(text); CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY = true; DaemonCodeAnalyzerSettings.getInstance().setImportHintEnabled(true); doHighlighting(); assertNoImportsAdded(); EditorTestUtil.executeAction(getEditor(), IdeActions.ACTION_COMMENT_BLOCK); doHighlighting(); UIUtil.dispatchAllInvocationEvents(); assertEmpty(highlightErrors()); assertEquals(2, ((PsiJavaFile)getFile()).getImportList().getAllImportStatements().length); }