I found the topics on streams and internalisation vs. collections and externalisation to be quite fascinating. The more I look at this particular problem the more that I wonder that it’s still maybe too low level - still describing a lot of “how do to something” rather than “what I wanted it to do”. But a great step in the right direction.
Possibly the ultimate evolution would be to embed SQL properly into Java code - using real SQL syntax rather than all this lambda business with its funny brackets and dashes and arrows and so on - and let some magic under the covers actually work out what it is you are trying to do. I dunno. Things just keep evolving from underneath me. I should have stuck with BASIC.
Cas