def _assert_msg_roundtrip_json(msg, raw_json):
to_json = json.loads(msg.to_json())<EOL>from_json = json.loads(raw_json)<EOL>assert sorted(to_json.items()) == sorted(from_json.items())<EOL>assert msg == msg.from_json(raw_json)<EOL>
Asserts that a msg gets serialized back into JSON with the
expected value, as well as gets serialized from JSON into
an expected object.