### Question:
HibernateMessageTemplateDAO extends HibernatePersistentObjectDAO<MessageTemplate> implements MessageTemplateDAO { @Override public List<MessageTemplate> findByLanguage(String language, long tenantId) { try { return findByWhere(" _entity.language='" + language + "' and _entity.tenantId=" + tenantId, "order by _entity.name", null); } catch (PersistenceException e) { log.error(e.getMessage(), e); return new ArrayList<MessageTemplate>(); } } HibernateMessageTemplateDAO(); @Override List<MessageTemplate> findByLanguage(String language, long tenantId); @Override List<MessageTemplate> findByTypeAndLanguage(String type, String language, long tenantId); @Override MessageTemplate findByNameAndLanguage(String name, String language, long tenantId); @Override boolean delete(long id, int code); @Override List<MessageTemplate> findByName(String name, long tenantId);  }### Answer:
@Test public void testFindByLanguage() { Collection<MessageTemplate> coll = dao.findByLanguage("en", 1L); Assert.assertEquals(6, coll.size()); coll = dao.findByLanguage("it", 1L); Assert.assertEquals(1, coll.size()); coll = dao.findByLanguage("de", 1L); Assert.assertEquals(0, coll.size()); }