void () { CaretModel caretModel = getEditor().getCaretModel(); caretModel.moveToVisualPosition(new VisualPosition(0, 0)); caretModel.addCaret(new VisualPosition(0, 1)); caretModel.addCaret(new VisualPosition(0, 2)); caretModel.addCaret(new VisualPosition(0, 3)); addCollapsedFoldRegion(0, 4, "..."); List<Caret> carets = caretModel.getAllCarets(); assertSize(1, carets); assertEquals(0, carets.get(0).getOffset()); }