A, TreeSet comparator:
1) Comparable: Entity class implements Comparable interface, override compareTo method;
2) Comparator: to write an implementation class implements Comparator interface, rewrite compare method; the object is to create an entity class TreeSet time passed;
3) Anonymous realize Comparatorl
二、Comparable: