When you create Streamfrom List, you are not allowed to change the source Listfrom Stream, as indicated in the “Non-Intervention” in the package documentation . Failure to comply with this restriction may result in damage to the structure ConcurrentModificationExceptionor, even worse, damaged structure without exception.
Java - , , .. ,
IntStream.range(0, list1.size()).forEach(ix -> list1.set(ix, list1.get(ix)+1));
Stream. ,
list1.replaceAll(i -> i + 1);
List , Java 8, -. , , , Iterable.forEach, Collection.removeIf List.sort, , Stream API. , Map , .
. " API, - Java SE 8 " .