I was tinkering with Java 8 lambdas just lately. It happened to be an early morning on a bus from Tallinn to Tartu and I probably didn't sleep enough the night before. So I managed to puzzle myself with this little piece of code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I actually expected it to print "Hello, lambda!" when executed, but it didn't. Can you figure out why? This is a very simple puzzler, and a very silly mistake that I made. I shouldn't have used the method reference to initialize the runner variable of RunForrestRun class. However, while the example is very simple, it actually shows that the new features do bring some accidental complexity into the language.
If you're an Eclipse user and considering to give IntelliJ IDEA a try - this is the finest read for you! If you're a convinced Eclipse (or NetBeans) user and not considering to switch to IntelliJ IDEA, still, you might learn something interesting from this report. If you are an IntelliJ IDEA fan, yet, you can find something interesting from this read.