void () { myBeforeMoveTask = () -> { EditorTestUtil.buildInitialFoldingsInBackground(getEditor()); getEditor().getFoldingModel().runBatchFoldingOperation(() -> { for (FoldRegion foldRegion : getEditor().getFoldingModel().getAllFoldRegions()) { foldRegion.setExpanded(false); } }); }; myAfterMoveTask = () -> { CodeFoldingManager.getInstance(getProject()).updateFoldRegions(getEditor()); for (FoldRegion foldRegion : getEditor().getFoldingModel().getAllFoldRegions()) { assertFalse(foldRegion.isExpanded()); } }; doTest(); }