title: What should be the logic of arranging data of same type in Set collection
body: <p><em><strong>What I am doing</em></strong></p>
  
  <p>I am reading all contacts from Phone, and storing them in to a Set. Syntax of Set is <code>Set&lt;String&gt; contactNumbers =  new HashSet&lt;String&gt;();</code> . And I am using this code to read contacts</p>
  
  <pre><code>phones = getContentResolver().query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                      new String[]{ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.TYPE},
                      ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = "+ id, // We need to add more selection for phone type
                      null,
                      null);
              if(phones != null) {
                  while(phones.moveToNext()){
                      switch(phones.getInt(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE))){
                          case Phone.TYPE_MOBILE :
                              contactNumbers.add(phones.getString(0).trim() + "M");
                              break;
                          case Phone.TYPE_HOME :
                              contactNumbers.add(phones.getString(0).trim() + "H");
                              break;
                          case Phone.TYPE_WORK :
                              contactNumbers.add(phones.getString(0).trim() + "W");
                              break;
                          case Phone.TYPE_OTHER :
                              contactNumbers.add(phones.getString(0).trim() + "O");
                              break;
                      }
                  }
              }
  </code></pre>
  
  <p><em><strong>Problem definition :</em></strong></p>
  
  <p>I want to arrange number with their category. Like if 5 numbers are with Home category 3 numbers of Work and 4 is from Other category, then I need to arrange all numbers in sort as "All numbers of a particular type should be in sequence". 
  for example my Set contains first 5 numbers related to Home, then all 3 numbers of Work and then all 4 numbers of Other category. How can I implement this logic?</p>