Tests with serialization