void () { @Language("JAVA") String text = """ class Foo { void m1() { } void m2() { } }"""; configure(text); assertEquals(2, getFoldRegionsCount()); assertEquals(2, getExpandedFoldRegionsCount()); myFixture.performEditorAction(IdeActions.ACTION_COLLAPSE_ALL_REGIONS); assertEquals(0, getExpandedFoldRegionsCount()); DocumentEx document = (DocumentEx)myFixture.getEditor().getDocument(); WriteCommandAction.runWriteCommandAction(myFixture.getProject(), () -> DocumentUtil.executeInBulk(document, () -> document.insertString(document.getText().indexOf("}