### Question:
HibernateDiagnosisDAO implements DiagnosisDAO { @Override public Diagnosis getDiagnosisByUuid(String uuid){ return (Diagnosis) sessionFactory.getCurrentSession().createQuery("from Diagnosis d where d.uuid = :uuid") .setString("uuid", uuid).uniqueResult(); }  void setSessionFactory(SessionFactory sessionFactory); @Override Diagnosis saveDiagnosis(Diagnosis diagnosis); @SuppressWarnings("unchecked") @Override List<Diagnosis> getActiveDiagnoses(Patient patient, Date fromDate); @Override List<Diagnosis> getDiagnoses(Encounter encounter); @Override List<Diagnosis> getPrimaryDiagnoses(Encounter encounter); @Override Diagnosis getDiagnosisById(Integer diagnosisId); @Override Diagnosis getDiagnosisByUuid(String uuid); @Override void deleteDiagnosis(Diagnosis diagnosis);  }### Answer:
@Test public void shouldGetDiagnosisByUuid() { Diagnosis diagnosis = diagnosisDAO.getDiagnosisByUuid("4e663d66-6b78-11e0-93c3-18a905e044dc"); assertEquals(1, (int) diagnosis.getId()); }