Tests for serialization