### Question:
DiagnosisServiceImpl extends BaseOpenmrsService implements DiagnosisService { @Override @Transactional(readOnly = true) public List<Diagnosis> getUniqueDiagnoses(Patient patient, Date fromDate) { List<Diagnosis> diagnoses = getDiagnoses(patient, fromDate); Set<CodedOrFreeText> answers = new HashSet<CodedOrFreeText>(); Iterator<Diagnosis> iterator = diagnoses.iterator(); while(iterator.hasNext()) { Diagnosis diagnosis = iterator.next(); if (!answers.add(diagnosis.getDiagnosis())) { iterator.remove(); } } return diagnoses; }  @Override Diagnosis save(Diagnosis diagnosis); @Override Diagnosis voidDiagnosis(Diagnosis diagnosis, String voidReason); @Override Diagnosis getDiagnosisByUuid(String uuid); @Override @Transactional(readOnly = true) List<Diagnosis> getDiagnoses(Patient patient, Date fromDate); @Override @Transactional(readOnly = true) List<Diagnosis> getPrimaryDiagnoses(Encounter encounter); @Override @Transactional(readOnly = true) List<Diagnosis> getUniqueDiagnoses(Patient patient, Date fromDate); @Override @Transactional(readOnly = true) Diagnosis getDiagnosis(Integer diagnosisId); @Override Diagnosis unvoidDiagnosis(Diagnosis diagnosis); @Override void purgeDiagnosis(Diagnosis diagnosis); DiagnosisDAO getDiagnosisDAO(); void setDiagnosisDAO(DiagnosisDAO diagnosisDAO);  }### Answer:
@Test public void getUniqueDiagnoses_shouldGetUniqueDiagnosesOfPatient(){ Patient patient = patientService.getPatient(2); List<Diagnosis> diagnoses = diagnosisService.getUniqueDiagnoses(patient, new Date(0)); Assert.assertEquals("68802cce-6880-17e4-6880-a68804d22fb7", diagnoses.get(0).getUuid()); Assert.assertEquals(ConditionVerificationStatus.CONFIRMED, diagnoses.get(0).getCertainty()); Assert.assertEquals(new Integer(1), diagnoses.get(0).getDiagnosisId()); Assert.assertEquals(new Integer(2), diagnoses.get(0).getPatient().getPatientId()); Assert.assertEquals(1, diagnoses.size()); }