### Question:
MessageStoreManagerImpl implements MessageStoreManager, ApplicationContextAware { public String parseTemplate(String template, Set<NameValuePair> templateParams) { String tag, value; if (templateParams == null) { return template; } for (NameValuePair detail : templateParams) { tag = "<" + detail.getName() + ">"; value = detail.getValue(); if (value != null && !value.isEmpty()) template = template.replaceAll(tag, value); } return template.trim(); }  GatewayRequest constructMessage(MessageRequest messageRequest, Language defaultLang); String parseTemplate(String template, Set<NameValuePair> templateParams); String formatPhoneNumber(String requesterPhone, MessageType type); CoreManager getCoreManager(); void setCoreManager(CoreManager coreManager); void setMaxConcat(int maxConcat); void setCharsPerSMS(int charsPerSMS); void setConcatAllowance(int concatAllowance); void setLocalNumberExpression(String localNumberExpression); void setDefaultCountryCode(String defaultCountryCode); void setApplicationContext(ApplicationContext applicationContext);  }### Answer:
@Test public void testParseTemplate() { System.out.println("parseTemplate"); String tpl = "Testing the <method> method of the <class> class"; Set<NameValuePair> params = new HashSet<NameValuePair>(); params.add(new NameValuePair("method", "parseTemplate")); params.add(new NameValuePair("class", "MessageStoreManagerImpl")); String expResult = "Testing the parseTemplate method of the MessageStoreManagerImpl class"; String result = instance.parseTemplate(tpl, params); assertEquals(expResult, result); }
@Test public void testParseTemplate_MissingParam() { System.out.println("parseTemplate"); String tpl = "Testing the <method> method of the <class> class"; Set<NameValuePair> params = new HashSet<NameValuePair>(); params.add(new NameValuePair("method", "parseTemplate")); String expResult = "Testing the parseTemplate method of the <class> class"; String result = instance.parseTemplate(tpl, params); assertEquals(expResult, result); }
@Test public void testParseTemplate_NULLParam() { System.out.println("parseTemplate"); String tpl = "Testing the <method> method of the <class> class"; String result = instance.parseTemplate(tpl, null); assertEquals(tpl, result); }