How can I call the setter in chain of Stream without using forEach()?
List<Foo> newFoos = foos.stream()
.filter(foo -> Foo::isBlue)
.map(foo -> foo.setTitle("Some value")) //I am unable to use this because also changing the data type into Object
.collect(Collectors.toList());
See Question&Answers more detail:os