I want to change the value of a field in a Stream. I am trying to change it in a .map but I got a compilation error
Syntax error on token(s), misplaced construct(s)
the stream:
user.getMenuAlertNotifications()
.parallelStream()
.filter(not -> not.getUser().getId()==userId &&
notificationList.getIds().contains(not.getId()))
.map(not -> not.setRead(Boolean.TRUE) -> not)
.forEach(not -> menuService.save(not));