@SuppressWarnings("unchecked")
@Test
public void canReadId() {

    TestEntity1 entity1 = new TestEntity1();
    entity1.afterPropertiesSet();
    ExplicitCacheEntry<String, TestEntity1> explicitCacheEntry1 = new ExplicitCacheEntry<String, TestEntity1>(
            entity1.getUniqueIdentifier(),
            entity1 );
    ObjectBuffer objectBuffer = new ObjectBuffer( kryo );
    byte[] data = objectBuffer.writeObjectData( explicitCacheEntry1 );
    assertThat( (String) serializer.readID( ByteBuffer.wrap( data ) ), is( entity1.getUniqueIdentifier() ) );
    ExplicitCacheEntry<Long, TestEntity1> explicitCacheEntry2 = objectBuffer.readObjectData( data, ExplicitCacheEntry.class );
    explicitCacheEntry1.getBean().assertMatch( explicitCacheEntry2.getBean() );
}