title: Java 8 streams unexpected behaviour
body: <p>This code returns the length of the longest String in a list of Strings. I have two solutions of which one works and the other doesn't</p>
  
  <h3>Correct</h3>
  
  <pre><code>System.out.println(listOfConsecutiveOneStrings.stream()
      .max(Comparator.comparing(String::length))
      .max(Comparator.comparing(String::length))
      .map(onesSequence -&gt; onesSequence.length())
      .get());
  </code></pre>
  
  <h3>Wrong</h3>
  
  <pre><code>System.out.println(listOfConsecutiveOneStrings.stream()
      .max(Comparator.comparing(String::length))
      .map(onesSequence -&gt; onesSequence.length())
      .max(Integer::max)
      .get());
  </code></pre>
  
  <p>Why is the first snippet correct and the second one incorrect?</p>