title: How to find max length in list of string using streams in Java?
body: <p>I have a class like below:</p>
  
  <pre><code>public class A
  {
      String name;
      String getName(){return name;}
  }
  </code></pre>
  
  <p>And I also have a list like below:</p>
  
  <pre><code>List&lt;A&gt; list_a = new ArrayList&lt;&gt;();
  //add n objects into list_a
  </code></pre>
  
  <p>Right now I would like to find the max length of object which is in list_a using streams in Java. I have created code like below:</p>
  
  <pre><code>final int max_len = list_a.stream().max(Comparator.comparingInt(A::getName::length));
  </code></pre>
  
  <p>But it does not work, I mean it is something bad with syntax. Could you help me with this? Thank you.</p>