java对存放实体的list进行排序:

List<DistributionAgentsEntity> allAgents = new ArrayList<DistributionAgentsEntity>();

Collections.sort(allAgents, new Comparator<DistributionAgentsEntity>() {
public int compare(DistributionAgentsEntity o1, DistributionAgentsEntity o2) {
return o2.getSum().compareTo(o1.getSum());
}
});