void () { runWithReparseDelay(0, () -> { @Language("JAVA") String text = """ class C {\s void m() { }\s }"""; configureByText(JavaFileType.INSTANCE, text); EditorTestUtil.buildInitialFoldingsInBackground(myEditor); waitForDaemon(); checkFoldingState("[FoldRegion -(22:27), placeholder='{}']"); JavaCodeFoldingSettings settings = JavaCodeFoldingSettings.getInstance(); boolean savedValue = settings.isCollapseMethods(); try { settings.setCollapseMethods(true); CodeFoldingConfigurableKt.applyCodeFoldingSettingsChanges(); waitForDaemon(); checkFoldingState("[FoldRegion +(22:27), placeholder='{}']"); } finally { settings.setCollapseMethods(savedValue); } }); }