### Question:
TemplateHelper { public String getXmlMessageTemplate(String templatePath) { return getMessageTemplate(templatePath, templatePath.endsWith(".xml") ? "" : "xml"); } private  TemplateHelper(String basePath, Charset charset); static TemplateHelper instance(String basePath, Charset charset); static TemplateHelper instance(String basePath); String getXmlMessageTemplate(String templatePath); String getJsonMessageTemplate(String templatePath); String getMessageTemplate(String templatePath, String templateExtension); Resource getFileResource(String resourcePath, String resourceExtension);  }### Answer:
@Test(dataProvider = "xmlTemplateDP") public void testGetXmlMessageTemplate(String basePath, String fileName, String expectedContent) throws Exception { final TemplateHelper testling = TemplateHelper.instance(basePath, UTF_8); try { final String content = testling.getXmlMessageTemplate(fileName); Assert.assertTrue(content.contains(expectedContent)); } catch (Exception e) { Assert.assertNull(expectedContent); } }