Serialization and unit tests