I have a list of Object and I want to first process each Object and then map them to another object and then collect them to a list. Like this:
list.stream().forEach(doSomething).map(mapFunction).collect()
But Java Stream does not support this,and I wander is there any elegant way to achieve the same result.
list.stream().peek(doSomething).map(mapFunction).collect()