ActionWorkItemInsertFactColumnSynchronizer extends ActionColumnSynchronizer { @Override public void append(final ColumnMetaData metaData) throws VetoException { if (!handlesAppend(metaData)) { return; } final ActionWorkItemInsertFactCol52 column = (ActionWorkItemInsertFactCol52) metaData.getColumn(); final String workItemName = column.getWorkItemName(); model.getActionCols() .stream() .filter(c -> c instanceof ActionWorkItemCol52) .map(c -> ((ActionWorkItemCol52) c)) .filter(c -> c.getWorkItemDefinition().getName().equals(workItemName)) .findFirst() .ifPresent(c -> findLastIndexOfWorkItemColumn(c).ifPresent(index -> { model.getActionCols().add(index + 1, column); synchroniseAppendColumn(column); })); }  @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 testAppend() throws VetoException { final ActionWorkItemInsertFactCol52 column = new ActionWorkItemInsertFactCol52(); column.setWorkItemName(WORK_ITEM_NAME); column.setHeader("col1"); modelSynchronizer.appendColumn(column); assertEquals(2, model.getActionCols().size()); assertEquals(5, uiModel.getColumns().size()); assertTrue(uiModel.getColumns().get(4) instanceof BooleanUiColumn); assertEquals(true, ((BaseMultipleDOMElementUiColumn) uiModel.getColumns().get(4)).isEditable()); }