@Test
public void testCompare() throws Exception {

    // sort just the descriptions to get the comparative order
    final Collection<String> sortedDescriptionsColl = new TreeSet<>();
    for (final SnomedConcept concept : TEST_DATA) {
        sortedDescriptionsColl.add(concept.candidatePreferred);
    }
    final List<String> sortedDescriptions = new ArrayList<>(sortedDescriptionsColl);
    // then use the comparator
    final List<SnomedConcept> sorted = new ArrayList<>(TEST_DATA);
    Collections.sort(sorted, new SnomedDescriptionComparator());
    // then check they concur
    for (int i = 0; i < sorted.size(); i++) {
        assertEquals(sortedDescriptions.get(i), sorted.get(i).candidatePreferred);
    }
}