}
}
Collections.sort(results, new Comparator<HProjectIteration>() {
@Override
public int compare(HProjectIteration o1, HProjectIteration o2) {
EntityStatus fromStatus = o1.getStatus();
EntityStatus toStatus = o2.getStatus();
if (fromStatus.equals(toStatus)) {
return 0;
}
if (fromStatus.equals(EntityStatus.ACTIVE)) {
return -1;
}
if (fromStatus.equals(EntityStatus.READONLY)) {
if (toStatus.equals(EntityStatus.ACTIVE)) {
return 1;
}
return -1;
}