void (@NotNull ArrangementMatchingRulesControl control, @NotNull List<int[]> mappings) { IntList rows = control.getSelectedModelRows(); int bottom = control.getModel().getSize(); for (int i = 0; i < rows.size(); i++) { int row = rows.getInt(i); if (row == bottom - 1) { mappings.add(new int[] { row, row }); bottom--; } else { mappings.add(new int[]{ row, row + 1 }); } } }