Source:
<code>public void getSetMembers_shouldReturnConceptSetMembersSortedWithRetiredLast() throws Exception { Concept c = new Concept(); Concept retiredConcept = new Concept(3); retiredConcept.setRetired(true); retiredConcept.setRetireReason("TEST"); retiredConcept.setRetiredBy(new User()); Concept retiredConcept2 = new Concept(0); retiredConcept2.setRetired(true); retiredConcept2.setRetireReason("TEST"); retiredConcept2.setRetiredBy(new User()); Concept retiredConcept3 = new Concept(0); retiredConcept3.setRetired(true); retiredConcept3.setRetireReason("TEST"); retiredConcept3.setRetiredBy(new User()); ConceptSet set0 = new ConceptSet(retiredConcept, 3.0); ConceptSet set1 = new ConceptSet(new Concept(1), 2.0); ConceptSet set2 = new ConceptSet(new Concept(2), 1.0); ConceptSet set3 = new ConceptSet(retiredConcept2, 0.0); ConceptSet set4 = new ConceptSet(); set4.setConcept(new Concept(3)); ConceptSet set5 = new ConceptSet(); set5.setConcept(retiredConcept3); List<ConceptSet> sets = new ArrayList<ConceptSet>(); sets.add(set0); sets.add(set1); sets.add(set2); sets.add(set3); sets.add(set4); sets.add(set5); c.setConceptSets(sets); List<Concept> setMembers = c.getSetMembers(); <START> Assert.assertEquals(set4.getConcept().getConceptId(), setMembers.get(0).getConceptId()); <END> Assert.assertEquals(set2.getConcept().getConceptId(), setMembers.get(1).getConceptId()); Assert.assertEquals(set1.getConcept().getConceptId(), setMembers.get(2).getConceptId()); Assert.assertEquals(set5.getConcept().getConceptId(), setMembers.get(3).getConceptId()); Assert.assertEquals(set3.getConcept().getConceptId(), setMembers.get(4).getConceptId()); Assert.assertEquals(set0.getConcept().getConceptId(), setMembers.get(5).getConceptId()); }</code><technical_language>Compare concepts conceptIds</technical_language>

Target:
public void getSetMembers_shouldReturnConceptSetMembersSortedWithRetiredLast() throws Exception { Concept c = new Concept(); Concept retiredConcept = new Concept(3); retiredConcept.setRetired(true); Concept retiredConcept2 = new Concept(0); retiredConcept2.setRetired(true); Concept retiredConcept3 = new Concept(0); retiredConcept3.setRetired(true); ConceptSet set0 = new ConceptSet(retiredConcept, 3.0); ConceptSet set1 = new ConceptSet(new Concept(1), 2.0); ConceptSet set2 = new ConceptSet(new Concept(2), 1.0); ConceptSet set3 = new ConceptSet(retiredConcept2, 0.0); ConceptSet set4 = new ConceptSet(); set4.setConcept(new Concept(3)); ConceptSet set5 = new ConceptSet(); set5.setConcept(retiredConcept3); List<ConceptSet> sets = new ArrayList<ConceptSet>(); sets.add(set0); sets.add(set1); sets.add(set2); sets.add(set3); sets.add(set4); sets.add(set5); c.setConceptSets(sets); List<Concept> setMembers = c.getSetMembers(); Assert.assertEquals(set4.getConcept().getConceptId(), setMembers.get(0).getConceptId()); Assert.assertEquals(set2.getConcept().getConceptId(), setMembers.get(1).getConceptId()); Assert.assertEquals(set1.getConcept().getConceptId(), setMembers.get(2).getConceptId()); Assert.assertEquals(set5.getConcept().getConceptId(), setMembers.get(3).getConceptId()); Assert.assertEquals(set3.getConcept().getConceptId(), setMembers.get(4).getConceptId()); Assert.assertEquals(set0.getConcept().getConceptId(), setMembers.get(5).getConceptId()); }