TreatmentComparator implements Comparator<Treatment> { public int compare(Treatment o1, Treatment o2) { return o1.getId().compareTo(o2.getId()); }  int compare(Treatment o1, Treatment o2); static final TreatmentComparator INSTANCE; }
@Test public void testCompare() { TreatmentComparator tc = TreatmentComparator.INSTANCE; assertTrue(tc.compare(new Treatment("A"), new Treatment("B")) < 0); assertTrue(tc.compare(new Treatment("B"), new Treatment("A")) > 0); assertTrue(tc.compare(new Treatment("A"), new Treatment("A")) == 0); assertTrue(tc.compare(new Treatment("A"), new Treatment("A", "Description")) == 0); }