void () { String text = "01234567"; configure(text); final FoldingModelImpl foldModel = (FoldingModelImpl)myFixture.getEditor().getFoldingModel(); foldModel.runBatchFoldingOperation(() -> { FoldRegion innerFold = foldModel.addFoldRegion(3, 5, "..."); FoldRegion outerFold = foldModel.addFoldRegion(2, 6, "..."); innerFold.setExpanded(false); collapse(outerFold); }); FoldRegion[] folds = foldModel.fetchVisible(); assertEquals(1, folds.length); assertEquals(2, folds[0].getStartOffset()); assertEquals(6, folds[0].getEndOffset()); }