### Question:
WxMpTemplateMessage implements Serializable { public String toJson() { return WxMpGsonBuilder.INSTANCE.create().toJson(this); }  WxMpTemplateMessage addData(WxMpTemplateData datum); String toJson();  }### Answer:
@Test public void testToJson() { WxMpTemplateMessage tm = WxMpTemplateMessage.builder() .toUser("OPENID") .templateId("ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY") .miniProgram(new WxMpTemplateMessage.MiniProgram("xiaochengxuappid12345", "index?foo=bar")) .url("http: .build(); tm.addData( new WxMpTemplateData("first", "haahah", "#FF00FF")); tm.addData( new WxMpTemplateData("remark", "heihei", "#FF00FF")); assertEquals(tm.toJson(), "{\"touser\":\"OPENID\",\"template_id\":\"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY\",\"url\":\"http: }