### Question:
MessageTemplateDAOImpl extends HibernateGenericDAOImpl<MessageTemplateImpl> implements MessageTemplateDAO<MessageTemplateImpl> { public MessageTemplate getTemplateByLangNotifMType(Language lang, NotificationType notif, MessageType type) { logger.debug("variables passed to getTemplateByLangNotifMType. language: " + lang + "And NotificationType: " + notif + "And MessageType: " + type); try { MessageTemplate template = (MessageTemplate) this.getSessionFactory().getCurrentSession().createCriteria(MessageTemplateImpl.class).add(Restrictions.eq("language", lang)).add(Restrictions.eq("notificationType", notif)).add(Restrictions.eq("messageType", type)).uniqueResult(); logger.debug(template); return template; } catch (NonUniqueResultException ne) { logger.error("Method getTemplateByLangNotifMType returned more than one MessageTemplate object", ne); return null; } catch (HibernateException he) { logger.error(" Persistence or JDBC Exception in Method getTemplateByLangNotifMType", he); return null; } catch (Exception ex) { logger.error("Exception in Method getTemplateByLangNotifMType", ex); return null; } }  MessageTemplate getTemplateByLangNotifMType(Language lang, NotificationType notif, MessageType type); MessageTemplate getTemplateByLangNotifMType(Language lang, NotificationType notif, MessageType type, Language defaultLang);  }### Answer:
@Test public void testGetTemplateByLangNotifMType() { System.out.println("getTemplateByLangNotifMType"); mtDao.getSessionFactory().getCurrentSession().save(mt2); MessageTemplate result = mtDao.getTemplateByLangNotifMType(l1, nt2, type); Assert.assertNotNull(result); Assert.assertEquals(mt2, result); }