title: Get min and max String of list
body: <p>I've got a <code>List&lt;String&gt; list</code> and want to get the first and last String of that list in alphabetical order. I want to solve that problem using the power of Java 8 and Streams with collectors.</p>
  
  <p>This does not work:</p>
  
  <pre><code>String first = list.stream().collect(Collectors.minBy(String.CASE_INSENSITIVE_ORDER));
  </code></pre>
  
  <p>It gives me a compiler error: </p>
  
  <blockquote>
    <p>Type mismatch: cannot convert from Optional to String</p>
  </blockquote>
  
  <p>Can you explain why and show me the best way to do what I want to do?</p>