Serialization to json, different ways to check equality