If my API provides a stream, is there a way for clients to modify the underlying collection?
For example:
class ListWrapper {
List<String> myList;
...
Stream<String> getStream() {
return myList.stream();
}
}
Is it possible for a client to call listWrapper.getStream() and somehow modify the contents of myList?