### Question:
HibernateConditionDAO implements ConditionDAO { @Override public List<Condition> getConditionHistory(Patient patient) { Query query = sessionFactory.getCurrentSession().createQuery( "from Condition con where con.patient.patientId = :patientId and con.voided = false " + "order by con.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 shouldGetConditionHistory() { Patient patient = new Patient(2); List<Condition> history = dao.getConditionHistory(patient); assertEquals(3, history.size()); }