SyntaxFix
Write A Post
Hire A Developer
Questions
You can use just forEach. No stream at all:
forEach
fruits.forEach(fruit -> fruit.setName(fruit.getName() + "s"));