Combining two functions into one
Every now and then, you may want to apply one function to only some of the elements in your stream. This is not so much an example of manipulating streams but rather of combining two functions into one with a predicated dictating which function to apply. In concrete terms, we will create a stream of the integers in the range 0 through 10 (non-inclusive), multiply the even numbers by two and add one, then...
Aug 18, 2014 — 2 minute(s) read