void () { VirtualFile dir = getFile("/src"); PsiTestUtil.addSourceContentToRoots(getModule(), dir); try { VirtualFile file = getFile("/src/Bar.java"); PsiJavaFile psiFile = (PsiJavaFile)getPsiManager().findFile(file); assertNotNull(psiFile); PsiMethod method = psiFile.getClasses()[0].getMethods()[0]; method.navigate(true); FileEditor[] editors = manager.getEditors(file); assertEquals(1, editors.length); Editor editor = ((TextEditor)editors[0]).getEditor(); EditorTestUtil.waitForLoading(editor); FoldRegion[] regions = editor.getFoldingModel().getAllFoldRegions(); assertEquals(2, regions.length); assertTrue(regions[0].isExpanded()); assertTrue(regions[1].isExpanded()); CodeInsightTestFixtureImpl.instantiateAndRun(psiFile, editor, new int[]{Pass.UPDATE_ALL, Pass.LOCAL_INSPECTIONS}, false); regions = editor.getFoldingModel().getAllFoldRegions(); assertEquals(2, regions.length); assertTrue(regions[0].isExpanded()); assertTrue(regions[1].isExpanded()); } finally { PsiTestUtil.removeSourceRoot(getModule(), dir); } }