void (int... coordinates) { int caretCount = coordinates.length / 4; List<Caret> carets = getEditor().getCaretModel().getAllCarets(); assertEquals("Unexpected caret count", caretCount, carets.size()); for (int i = 0; i < caretCount; i++) { Caret caret = carets.get(i); assertEquals("Unexpected position for caret " + (i + 1), new VisualPosition(coordinates[i * 4], coordinates[i * 4 + 1]), caret.getVisualPosition()); assertEquals("Unexpected selection start for caret " + (i + 1), new VisualPosition(coordinates[i * 4], coordinates[i * 4 + 2]), caret.getSelectionStartPosition()); assertEquals("Unexpected selection end for caret " + (i + 1), new VisualPosition(coordinates[i * 4], coordinates[i * 4 + 3]), caret.getSelectionEndPosition()); } }