Actually update the result variable in the loop.
Use flatMap to simplify.
Using Stream.of rather than an intermediate list.
Replace the intermediate list by Stream.of.
Using Stream.of rather than an intermediate list.
Using Stream.of.