void (int[][] ranges) { int[] selectionStarts = getEditor().getSelectionModel().getBlockSelectionStarts(); int[] selectionEnds = getEditor().getSelectionModel().getBlockSelectionEnds(); int actualRangeCount = selectionStarts.length; int[][] actualRanges = new int[actualRangeCount][]; for (int i = 0; i < actualRangeCount; i++) { actualRanges[i] = new int[] {selectionStarts[i], selectionEnds[i]}; } assertEquals("Wrong selected ranges", Arrays.deepToString(ranges), Arrays.deepToString(actualRanges)); }