ActionWorkItemInsertFactColumnSynchronizer extends ActionColumnSynchronizer { @Override public List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData, final ColumnMetaData editedMetaData) throws VetoException { if (!(handlesUpdate(originalMetaData) && handlesUpdate(editedMetaData))) { return Collections.emptyList(); } final ActionWorkItemInsertFactCol52 originalColumn = (ActionWorkItemInsertFactCol52) originalMetaData.getColumn(); final ActionWorkItemInsertFactCol52 editedColumn = (ActionWorkItemInsertFactCol52) editedMetaData.getColumn(); final List<BaseColumnFieldDiff> diffs = originalColumn.diff(editedColumn); update(originalColumn, editedColumn); final boolean isHideUpdated = BaseColumnFieldDiffImpl.hasChanged(ActionWorkItemInsertFactCol52.FIELD_HIDE_COLUMN, diffs); final boolean isHeaderUpdated = BaseColumnFieldDiffImpl.hasChanged(ActionWorkItemInsertFactCol52.FIELD_HEADER, diffs); if (isHideUpdated) { setColumnVisibility(originalColumn, originalColumn.isHideColumn()); } if (isHeaderUpdated) { setColumnHeader(originalColumn, originalColumn.getHeader()); } return diffs; }  @Override int priority(); @Override boolean handlesAppend(final MetaData metaData); @Override void append(final ColumnMetaData metaData); @Override boolean handlesUpdate(final MetaData metaData); @Override List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData,
                                            final ColumnMetaData editedMetaData); @Override boolean handlesMoveColumnsTo(final List<? extends MetaData> metaData);  }
@Test public void testUpdate() throws VetoException { final ActionWorkItemInsertFactCol52 column = spy(new ActionWorkItemInsertFactCol52()); column.setWorkItemName(WORK_ITEM_NAME); column.setHeader("col1"); modelSynchronizer.appendColumn(column); final ActionWorkItemInsertFactCol52 edited = new ActionWorkItemInsertFactCol52(); edited.setWorkItemName(WORK_ITEM_NAME); edited.setWidth(column.getWidth()); edited.setHideColumn(true); edited.setHeader("updated"); List<BaseColumnFieldDiff> diffs = modelSynchronizer.updateColumn(column, edited); assertEquals(2, diffs.size()); verify(column).diff(edited); assertEquals(2, model.getActionCols().size()); assertEquals(5, uiModel.getColumns().size()); assertTrue(uiModel.getColumns().get(4) instanceof BooleanUiColumn); assertEquals("updated", uiModel.getColumns().get(4).getHeaderMetaData().get(1).getTitle()); assertEquals(false, uiModel.getColumns().get(4).isVisible()); }