### Question:
HibernateConditionDAO implements ConditionDAO { @Override public List<Condition> getActiveConditions(Patient patient) { Query query = sessionFactory.getCurrentSession().createQuery( "from Condition c where c.patient.patientId = :patientId and c.voided = false and c.endDate is null order " + "by c.onsetDate desc"); query.setInteger("patientId", patient.getId()); return query.list(); }  void setSessionFactory(SessionFactory sessionFactory); @Override Condition saveCondition(Condition condition); @Override Condition getCondition(Integer conditionId); @Override Condition getConditionByUuid(String uuid); @Override List<Condition> getConditionHistory(Patient patient); @Override List<Condition> getActiveConditions(Patient patient); @Override void deleteCondition(Condition condition);  }### Answer:
@Test public void shouldGetActiveConditions() { Patient patient = new Patient(2); List<Condition> active = dao.getActiveConditions(patient); assertEquals(2, active.size()); }