Collection.sort()
Collections.sort(rules, new Comparator<Rule>() {
public int compare(Rule o1, Rule o2) {
return o2.getSort() - o1.getSort();
}
);
Collections.sort(rules, new Comparator<Rule>() {
public int compare(Rule o1, Rule o2) {
return o2.getSort() - o1.getSort();
}
);