public int compare(IntegrationEntity o1, IntegrationEntity o2) {
EntityType e1 = o1.getEntityType();
EntityType e2 = o2.getEntityType();
// We want folders to appear before entities - the Folder EntityType is
// the next-to-last entity type, so we need to reverse the comparison:
int ret = e2.compareTo(e1);
if (ret == 0) {
ret = o1.getName().compareToIgnoreCase(o2.getName());
}
return ret;
}