void () { @SuppressWarnings("ALL") @Language("JAVA") String text = """ class Foo { public static void main() { new Runnable(){ public void run() { } }.run(); } }"""; configure(text); assertEquals(3, getFoldRegionsCount()); myFixture.getEditor().getCaretModel().moveToOffset(text.indexOf("new")); myFixture.performEditorAction(IdeActions.ACTION_EXPAND_TO_LEVEL_1); assertEquals(2, getExpandedFoldRegionsCount()); myFixture.performEditorAction(IdeActions.ACTION_EXPAND_ALL_TO_LEVEL_1); assertEquals(1, getExpandedFoldRegionsCount()); }