void () { addCollapsedFoldRegion(0, 10, "..."); addCollapsedFoldRegion(1, 9, "..."); runWriteCommand(() -> getEditor().getDocument().deleteString(0, 1)); addFoldRegion(20, 21, "..."); // an arbitrary action to rebuild folding caches assertTrue(myModel.isOffsetCollapsed(5)); }