Refactor serialization test for hash order