SystemControlledColumnValuesSynchronizer { public void insertRow(final int rowIndex) { prioritySynchronizer.insertRow(rowIndex); updateSystemControlledColumnValues((a, b) -> {}); } SystemControlledColumnValuesSynchronizer(final GuidedDecisionTable52 model,
                                                    final GuidedDecisionTableUiModel uiModel,
                                                    final GridWidgetCellFactory gridWidgetCellFactory,
                                                    final CellUtilities cellUtilities,
                                                    final ColumnUtilities columnUtilities); void updateSystemControlledColumnValues(); void deleteRow(final int rowIndex); void insertRow(final int rowIndex); void appendRow();  }
@Test public void testInsertionAtBeginning() throws Exception { addRowWithPriorityOver(""); addRowWithPriorityOver("1"); addRowWithPriorityOver("1"); addRowWithPriorityOver("2"); addRowWithPriorityOver("4"); modelSynchronizer.insertRow(0); uiModel.setCellValue(0, 3, new GuidedDecisionTableUiCell<>("")); assertPriorities(Arrays.asList("", "", "2", "2", "3", "5")); }
@Test public void testInsertionIntoMiddle() throws Exception { addRowWithPriorityOver(""); addRowWithPriorityOver("1"); addRowWithPriorityOver("1"); addRowWithPriorityOver("2"); addRowWithPriorityOver("4"); modelSynchronizer.insertRow(3); uiModel.setCellValue(3, 3, new GuidedDecisionTableUiCell<>("")); assertPriorities(Arrays.asList("", "1", "1", "", "2", "5")); }
@Test public void testInsertionOnPlaceOfUsedRows() throws Exception { addRowWithPriorityOver(""); addRowWithPriorityOver("1"); addRowWithPriorityOver("1"); addRowWithPriorityOver("2"); addRowWithPriorityOver("4"); modelSynchronizer.insertRow(4); uiModel.setCellValue(4, 3, new GuidedDecisionTableUiCell<>("")); assertPriorities(Arrays.asList("", "1", "1", "2", "", "5")); }