There is a List list . I want to run through all the elements and double them.
list.spliterator().forEachRemaining(e -> e*2); As a result, my sheet remains unchanged.
I can do it like this:
List newList = new ArrayList<>(); for(int e in list) { newList.add(e); } But the last version is shorter. I want to do this with the help of a lambda function. What are the options?