title: Custom Sorting in way that A comes before a and B comes before b
body: <p>I have a List of colors like this: </p>
  
  <blockquote>
    <p>Pink, Blue, Red, blue, Grey, green, purple, black ...etc</p>
  </blockquote>
  
  <pre><code>List&lt;String&gt; listOfColors =  Arrays.asList("Pink", "Blue", "Red", "blue", "Grey", "green", "purple", "black");
  </code></pre>
  
  <p>There are some intermediate operation like filtering some fruit colors, now I am left with filtered results where I want them to be sorted in order: </p>
  
  <blockquote>
    <p>Blue, black, blue, Grey, green, Pink, purple, Red</p>
  </blockquote>
  
  <p>I have tried :    </p>
  
  <pre class="lang-java prettyprint-override"><code>List&lt;String&gt; collect = listOfColors.stream().sorted(String::compareToIgnoreCase)
          .collect(Collectors.toList());
  </code></pre>
  
  <p>It does not work as expected. </p>
  
  <p>The output is the following: </p>
  
  <blockquote>
    <p>black, Blue, blue, green, Grey, Pink, purple, Red</p>
  </blockquote>
  
  <p>I want the following:</p>
  
  <blockquote>
    <p>Blue, black, blue, Grey, green, Pink, purple, Red</p>
  </blockquote>