### Question:
HibernateObsDAO implements ObsDAO { @Override @SuppressWarnings("unchecked") public List<Obs> getObservations(List<Person> whom, List<Encounter> encounters, List<Concept> questions, List<Concept> answers, List<PERSON_TYPE> personTypes, List<Location> locations, List<String> sortList, Integer mostRecentN, Integer obsGroupId, Date fromDate, Date toDate, boolean includeVoidedObs, String accessionNumber) throws DAOException { Criteria criteria = createGetObservationsCriteria(whom, encounters, questions, answers, personTypes, locations, sortList, mostRecentN, obsGroupId, fromDate, toDate, null, includeVoidedObs, accessionNumber); return criteria.list(); }  void setSessionFactory(SessionFactory sessionFactory); @Override void deleteObs(Obs obs); @Override Obs getObs(Integer obsId); @Override Obs saveObs(Obs obs); @Override @SuppressWarnings("unchecked") List<Obs> getObservations(List<Person> whom, List<Encounter> encounters, List<Concept> questions,
	        List<Concept> answers, List<PERSON_TYPE> personTypes, List<Location> locations, List<String> sortList,
	        Integer mostRecentN, Integer obsGroupId, Date fromDate, Date toDate, boolean includeVoidedObs,
	        String accessionNumber); @Override Long getObservationCount(List<Person> whom, List<Encounter> encounters, List<Concept> questions,
	        List<Concept> answers, List<PERSON_TYPE> personTypes, List<Location> locations, Integer obsGroupId,
	        Date fromDate, Date toDate, List<ConceptName> valueCodedNameAnswers, boolean includeVoidedObs,
	        String accessionNumber); @Override Obs getObsByUuid(String uuid); @Override Obs getRevisionObs(Obs initialObs); @Override Obs.Status getSavedStatus(Obs obs);  }### Answer:
@Test public void getObservations_shouldBeOrderedCorrectly() { Session session = sessionFactory.getCurrentSession(); List<Obs> obsListActual; List<Obs> obsListExpected; obsListExpected = session.createCriteria(Obs.class, "obs").addOrder(Order.desc("id")).list(); obsListActual = dao.getObservations(null, null, null, null, null, null, Collections.singletonList("id"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); obsListActual = dao.getObservations(null, null, null, null, null, null, Collections.singletonList("id desc"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); obsListExpected = session.createCriteria(Obs.class, "obs").addOrder(Order.asc("id")).list(); obsListActual = dao.getObservations(null, null, null, null, null, null, Collections.singletonList("id asc"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); obsListExpected = session.createCriteria(Obs.class, "obs").addOrder(Order.asc("person.id")).addOrder( Order.desc("id")).list(); obsListActual = dao.getObservations(null, null, null, null, null, null, Arrays.asList("person.id asc", "id"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); obsListExpected = session.createCriteria(Obs.class, "obs").addOrder(Order.asc("person.id")) .addOrder(Order.asc("id")).list(); obsListActual = dao.getObservations(null, null, null, null, null, null, Arrays.asList("person.id asc", "id asc"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); }