added unit test for serialization from bytes