Customer类实现Comparable接口,
public class Customer implements Comparable<Customer>{
private int age;
```
public int compareTo(Customer o){
if(this.age>=o.getAge())
retrun 1;
}
retrun -1;
}
List<Customer> list=new ArrayList<Customer>();
list.sort(Comparator.naturalOrder());//从小到大排序