Finding the longest string and its length using Java streams Java 8 streams are my new golden hammer that I try to use as often as possible with often enormous gains in brevity and readability. Getting multiple return values, such as a maximum value and its associated element, is a bit cumbersome though (and requires an additional "pair" class).

Should I go back to "normal Java" for this task or is this syntax preferable? Is there a more concise way? 

List&lt;String&gt; names = Arrays.asList("John","Paul","Ringo"); 
Pair&lt;String,Integer&gt; longestName = names.stream()
 .map(n-&gt;new Pair&lt;&gt;(n,n.length())) // pretend n.length() to be a lengthy operation
 .max(Comparator.comparing(Pair::getB)).get();
System.out.println(longestName.getA()+" "+longestName.getB());


P.S.: With "lengthy operation" I mean long running, as in I don't want to calculate it twice.
You don't need the Pair.  You can get the String with the maximum length by doing

names.stream().max(Comparator.comparingInt(String::length))