Wow the CTO of Speedment posted a challenge and the "winner" used Speedment? Who would have thought... Also when it comes to code golfing this is a BS experiment. If you don't count the library LOC then I can just create SpeedmentSucksLib that literally just uses the code that "won" and now my solution is 1 line:
SpeedmentSucksLib.doTheThing()
Also we just are going to ignore import/main class LOC's? Really this is a terrible article and it leaves a bad taste in my mouth re: speedment.
Your proposed "solution" is hardly a general solution. The winner used a java.util.stream.Stream class which is a standard Java class. The rules (https://www.speedment.com/code-one/) stated that import/main class rows were not counted. But even if they did, they would impact any solution about the same.