Test toJson too.