void (Editor editor, int... offsets) { final List<Caret> carets = editor.getCaretModel().getAllCarets(); assertEquals("Carets count mismatch", offsets.length, carets.size()); for (int i = 0; i < offsets.length; i++) { assertEquals("Position mismatch for caret " + i, offsets[i], carets.get(i).getOffset()); } }