a spliterator reporting either, IMMUTABLE or CONCURRENT, is guaranteed to never throw a ConcurrentModificationException. Of course, CONCURRENT precludes SIZED semantically, but that has no consequence to the client code.
In fact, these characteristics are not used for anything in the Stream API, hence, using them inconsistently would never get noticed somewhere.
This is also the explanation why every intermediate operation has the effect of clearing the CONCURRENT, IMMUTABLE and NONNULL characteristics: the Stream implementation doesn’t use them and its internal classes representing the stream state do not maintain them.
if stream doesnt use CHARACTERISTICS from source then how stream works parallely? does stream completely ignores the stream source characteristics?
from this question Collector does not know that im using a concurrent collection provided by Supplier, so characteristics are not infered from type of collector container
- under what circumstances stream API considers characteristics ?
- which operation resets which characteristics ?