title: Sort Map<String, Object> by keys with IgnoreCase?
body: <p>Well, I tested TreeMap but it doesn't take in account IgnoreCase on string comparision. I need to order lexicographically and ignoring case. Is there any other way?</p>
  
  <p>Thanks, that works (TreeMap (Comparator c)). However, I have another question:</p>
  
  <pre><code>public final Comparator&lt;Object&gt; STR_IGN_CASE_COMP = new Comparator&lt;Object&gt;() {
  
      public int compare(Object h1, Object h2) {
              String s1 = h1.getId();
              String s2 = h2.getId();
              return s1.compareToIgnoreCase(s2);
      }
  }; //STR_IGN_CASE_COMP
  </code></pre>
  
  <p>How can I universialize the comparator to work with different objects? assuming all have the getId() method. </p>
  
  <p>Thanks,
  Martin</p>