void () { FoldRegion c = addCollapsedFoldRegion(0, 10, "..."); FoldRegion e = addFoldRegion(1, 10, "..."); runWriteCommand(() -> getEditor().getDocument().deleteString(0, 1)); assertFalse(e.isValid()); assertTrue(c.isValid()); FoldRegion survivor = assertOneElement(myModel.getAllFoldRegions()); assertSame(c, survivor); }