Is there a way in Java 8 to transform an Array/Collection using map()
without having to reassign the created copy, e.g.
Arrays.stream(array).mapInPlace(x -> x / 100);
list.stream().mapInPlace(e -> e.replaceAll(" ", ""));
instead of
array = Arrays.stream(array).map(x -> x / 100).toArray();
list = list.stream().map(e -> e.replaceAll(" ", "")).collect(Collectors.toList());
?
If not, what's the reason for this design decision?