### Question:
LanguageDAOImpl extends HibernateGenericDAOImpl<LanguageImpl> implements LanguageDAO<LanguageImpl> { public Language getByCode(String code) { logger.debug("variable passed to getByCode: " + code); try { Language lang = (Language) this.getSessionFactory().getCurrentSession().createCriteria(LanguageImpl.class).add(Restrictions.eq("code", code)).uniqueResult(); logger.debug(lang); return lang; } catch (NonUniqueResultException ne) { logger.error("getByCode returned more than one object", ne); return null; } catch (HibernateException he) { logger.error("Persistence or jdbc Exception in Method getByCode", he); return null; } catch (Exception e) { logger.error("Exception in getByCode", e); return null; } } LanguageDAOImpl(); Language getByCode(String code);  }### Answer:
@Test public void testGeByCode() { System.out.print("test getIdByCode"); Language expResult = l2; Language Result = lDao.getByCode(code); Assert.assertNotNull(Result); Assert.assertEquals(expResult, Result); }
@Test public void testGetByUnexistantCode() { System.out.print("test Language getByCode with unexistant code"); String code = "dd"; Language result = lDao.getByCode(code); Assert.assertNull(result); }