### Question:
ApiaryListenerEventFactory { public ApiaryCreateTableEvent create(CreateTableEvent event) { return new ApiaryCreateTableEvent(addParams(event)); }  ApiaryCreateTableEvent create(CreateTableEvent event); ApiaryAlterTableEvent create(AlterTableEvent event); ApiaryDropTableEvent create(DropTableEvent event); ApiaryAddPartitionEvent create(AddPartitionEvent event); ApiaryAlterPartitionEvent create(AlterPartitionEvent event); ApiaryDropPartitionEvent create(DropPartitionEvent event); ApiaryInsertEvent create(InsertEvent event);  }### Answer:
@Test public void createSerializableCreateTableEvent() { CreateTableEvent event = mockEvent(CreateTableEvent.class); ApiaryListenerEvent serializableEvent = factory.create(event); assertCommon(serializableEvent); assertThat(serializableEvent.getEventType()).isSameAs(EventType.ON_CREATE_TABLE); }
@Test public void createSerializableAlterTableEvent() { AlterTableEvent event = mockEvent(AlterTableEvent.class); ApiaryListenerEvent serializableEvent = factory.create(event); assertCommon(serializableEvent); assertThat(serializableEvent.getEventType()).isSameAs(EventType.ON_ALTER_TABLE); }
@Test public void createSerializableDropTableEvent() { DropTableEvent event = mockEvent(DropTableEvent.class); ApiaryListenerEvent serializableEvent = factory.create(event); assertCommon(serializableEvent); assertThat(serializableEvent.getEventType()).isSameAs(EventType.ON_DROP_TABLE); }
@Test public void createSerializableAddPartitionEvent() { AddPartitionEvent event = mockEvent(AddPartitionEvent.class); when(event.getPartitionIterator()).thenReturn(partitionIterator); ApiaryListenerEvent serializableEvent = factory.create(event); assertCommon(serializableEvent); assertThat(serializableEvent.getEventType()).isSameAs(EventType.ON_ADD_PARTITION); }
@Test public void createSerializableAlterPartitionEvent() { AlterPartitionEvent event = mockEvent(AlterPartitionEvent.class); ApiaryListenerEvent serializableEvent = factory.create(event); assertCommon(serializableEvent); assertThat(serializableEvent.getEventType()).isSameAs(EventType.ON_ALTER_PARTITION); }
@Test public void createSerializableDropPartitionEvent() { DropPartitionEvent event = mockEvent(DropPartitionEvent.class); when(event.getPartitionIterator()).thenReturn(partitionIterator); ApiaryListenerEvent serializableEvent = factory.create(event); assertCommon(serializableEvent); assertThat(serializableEvent.getEventType()).isSameAs(EventType.ON_DROP_PARTITION); }
@Test public void createSerializableInsertEvent() { InsertEvent event = mockEvent(InsertEvent.class); ApiaryListenerEvent serializableEvent = factory.create(event); assertCommon(serializableEvent); assertThat(serializableEvent.getEventType()).isSameAs(EventType.ON_INSERT); }