title: How to give Rank in list of Object and sort on the basis of Rank and any other key?
body: <p>I have a situation where I need to make a list of object , where Object have (Name, Title) element. for e.g. :</p>
  
  <pre><code>obj1 = ('john', 'colonel')
  obj2 = ('Alex', 'major')
  obj3 = ('Roy', 'Major general')
  obj4 = ('derrick', 'no Rank')
  </code></pre>
  
  <p>I need to do sorting in two ways:
  1. First on the Title basis.
  2. For any two names, if the title is same then sorting of object on the 
     alphabetical name basis(like chronological order of name).
  3. And also need to remove duplicate names from the list.</p>
  
  <p>Please help me out as I know how to sort the arraylist but don't know how to give ranking and sort on multiple conditions. If you need further details or do not understand my question then please let me know.</p>