void () { initText("a\nb"); FoldingModelEx model = (FoldingModelEx)getEditor().getFoldingModel(); Ref<FoldRegion> regionRef = new Ref<>(); runFoldingOperation(() -> { FoldRegion region = model.createFoldRegion(0, 3, "...", null, true); assertNotNull(region); assertTrue(region.isValid()); assertFalse(region.isExpanded()); regionRef.set(region); }); runFoldingOperation(() -> model.removeFoldRegion(regionRef.get())); assertEquals(new VisualPosition(1, 1), getEditor().offsetToVisualPosition(3)); }