@Test public void shouldCompareTwoEntities() throws Exception { EntityDto person = new EntityDto("org.motechproject.openmrs.ws.resource.model.Person"); EntityDto appointment = new EntityDto("org.motechproject.appointments.api.model.Appointment"); assertTrue(comparator.compare(person, appointment) > 0); assertTrue(comparator.compare(appointment, person) < 0); assertTrue(comparator.compare(person, person) == 0); assertTrue(comparator.compare(appointment, appointment) == 0); }
@Override public int compare(EntityDto one, EntityDto two) { return one.getName().compareToIgnoreCase(two.getName()); }
EntityNameComparator implements Comparator<EntityDto>, Serializable { @Override public int compare(EntityDto one, EntityDto two) { return one.getName().compareToIgnoreCase(two.getName()); } }
EntityNameComparator implements Comparator<EntityDto>, Serializable { @Override public int compare(EntityDto one, EntityDto two) { return one.getName().compareToIgnoreCase(two.getName()); }  }
EntityNameComparator implements Comparator<EntityDto>, Serializable { @Override public int compare(EntityDto one, EntityDto two) { return one.getName().compareToIgnoreCase(two.getName()); }  @Override int compare(EntityDto one, EntityDto two); }
EntityNameComparator implements Comparator<EntityDto>, Serializable { @Override public int compare(EntityDto one, EntityDto two) { return one.getName().compareToIgnoreCase(two.getName()); }  @Override int compare(EntityDto one, EntityDto two);  }