void () { FoldRegion inner = addCollapsedFoldRegion(10, 15, "inner"); addFoldRegion(10, 20, "outer"); runWriteCommand(() -> getEditor().getDocument().deleteString(15, 20)); Assert.assertArrayEquals(new FoldRegion[]{inner}, myModel.fetchTopLevel()); }