@Test
public void shouldSerializeAndDeserializeRowKey() throws Exception {
IdSourceKeyMetadata keyMetadata = IdSourceKeyMetadata.forTable( "Hibernate_Sequences", "sequence_name", "next_val" );
// given
IdSourceKey key = IdSourceKey.forTable( keyMetadata, "Foo_Sequence" );
// when
byte[] bytes = externalizerHelper.marshall( key );
IdSourceKey unmarshalledKey = externalizerHelper.unmarshall( bytes );
// then
assertThat( unmarshalledKey.getTable() ).isEqualTo( key.getTable() );
assertThat( unmarshalledKey.getColumnNames() ).isEqualTo( key.getColumnNames() );
assertThat( unmarshalledKey.getColumnValues() ).isEqualTo( key.getColumnValues() );
assertTrue( key.equals( unmarshalledKey ) );
assertTrue( unmarshalledKey.equals( key ) );
assertThat( unmarshalledKey.hashCode() ).isEqualTo( key.hashCode() );
}