RichardWarburton/java-8-lambdas-exercises — pull request #5 by algirdasrascius (2014-10-08 20:27:00+00:00)
Title: Fixed StreamExercises.map() method

Contract of Stream.reduce method requires that accumulator function
does not mutate its arguments. Previous implementation of
StreamExercises.map() method was using accumulator that were mutating
list passed as argument. Mutating parameters in accumulator function
results in incorrect behaviour when parallel stream is processed.

New implementation of StreamExercises.map() copies argument lists
in accumulator functions.

Unit test StreamExercisesTest was updated to check functionality of
StreamExercises.map() with parallel streams.