title: Case-insensitive sorted Set - keep same string with different case
body: <p>Today I have a case-insensitive sorted <code>Set</code> like:</p>
  
  <pre class="lang-java prettyprint-override"><code>Set&lt;String&gt; set = new TreeSet&lt;&gt;(String.CASE_INSENSITIVE_ORDER);
  set.add("foo");
  set.add("FOO");
  set.add("bar");
  System.out.println(set.toString());
  </code></pre>
  
  <p>The output of this is:</p>
  
  <pre class="lang-none prettyprint-override"><code>[bar, foo]
  </code></pre>
  
  <p>But what I really wanted was:</p>
  
  <pre class="lang-none prettyprint-override"><code>[bar, FOO, foo]
  </code></pre>
  
  <p>That is, I want the <em>sorting</em> of the set to be case-insensitive, but I want to be able to have same string with different cases (like "foo" and "FOO") in the set, without the last one being discarded.</p>
  
  <p>I know I could sort a <code>List</code>, but in my case I need a <code>Set</code>.</p>
  
  <p>Is there a neat way of doing this in Java?</p>