AttributeColumnSynchronizer extends BaseColumnSynchronizer<ColumnMetaData, ColumnMetaData, ColumnMetaData> { @Override public boolean handlesMoveColumnsTo(final List<? extends MetaData> metaData) throws VetoException { for (MetaData md : metaData) { if (!(md instanceof MoveColumnToMetaData)) { return false; } final BaseColumn column = ((MoveColumnToMetaData) md).getColumn(); if (!(column instanceof AttributeCol52)) { return false; } } return metaData.size() == 1; }  @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 handlesDelete(final MetaData metaData); @Override void delete(final ColumnMetaData metaData); @Override boolean handlesMoveColumnsTo(final List<? extends MetaData> metaData); @Override void moveColumnsTo(final List<MoveColumnToMetaData> metaData);  }
@Test public void checkHandlesMoveColumnsToWithEmptyMetadata() throws VetoException { final AttributeColumnSynchronizer synchronizer = new AttributeColumnSynchronizer(); assertFalse(synchronizer.handlesMoveColumnsTo(Collections.emptyList())); }
@Test public void checkHandlesMoveColumnsToWithMultipleMetadata() throws VetoException { final MoveColumnToMetaData md0 = mock(MoveColumnToMetaData.class); final MoveColumnToMetaData md1 = mock(MoveColumnToMetaData.class); final AttributeColumnSynchronizer synchronizer = new AttributeColumnSynchronizer(); when(md0.getColumn()).thenReturn(mock(AttributeCol52.class)); when(md1.getColumn()).thenReturn(mock(AttributeCol52.class)); assertFalse(synchronizer.handlesMoveColumnsTo(Arrays.asList(md0, md1))); }
@Test public void checkHandlesMoveColumnsToWithSingleMetadata() throws VetoException { final MoveColumnToMetaData md0 = mock(MoveColumnToMetaData.class); final AttributeColumnSynchronizer synchronizer = new AttributeColumnSynchronizer(); when(md0.getColumn()).thenReturn(mock(AttributeCol52.class)); assertTrue(synchronizer.handlesMoveColumnsTo(Collections.singletonList(md0))); }