FstSerializer implements Serializer { @Override public Object deserialize(byte[] bytes) { return fst.asObject(bytes); } private  FstSerializer(); @Override byte[] serialize(Serializable object); @Override Object deserialize(byte[] bytes); static FstSerializer create();  }
@Test public void deserialize() throws Exception { String stringData = "fooBar"; byte[] serialized = serializer.serialize(stringData); Object deserialized = serializer.deserialize(serialized); assertEquals(stringData, deserialized); }