I am using a treeset which contains employee class
TreeSet<Employee> ts = new TreeSet<Employee>(new ComparatorEmpId());
1)My treeset should be sorted by employee Id
2)(But I want to get the highest salaried employee from treeset (using last) . how do i do that ?
3)[I tried to use comparator for sorting the employee Id , but for getting a highest salary I should have had the salary attribute sorted ]