This is a sample demonstrating some JDK 8 features I am using.
Here is the test class demonstrating some JDK 8 functionality.
and here is the resulting output:
The regular expression from SampleEnum.flatList() is: (Item1|Item2|Item3|Item4).*
[Item1] matches
[Item3] matches
[Item4 with extra] matches
I am far from an expert on functional programming but I do like to dabble in them. I do think there are times where the new JDK 8 functionality will promote smaller (and hopefully more maintainable) code. A famous quote seems appropriate here - "With great power comes great responsibility". I also foresee some real ugly code being spawned into existence. I will try to take the good with the bad and try to use the tools at hand to make things better rather than worse.
No comments:
Post a Comment