forEach seems like a more suitable tool for the job, but if you don't want to use it, you can always define an anonymous multiline lambda:
List<Foo> foos = foos.stream()
.filter(foo -> Foo::isBlue)
.map(foo -> {
foo.setTitle("Some value");
return foo;
})
.collect(Collectors.toList());
source
share