I have an EnumSet
which is final and immutable i.e. initialized once in the constructor.
Is the contains()
method on this EnumSet
thread safe? It is internally using an iterator to make the contains check. Hence if two threads are simultaneously calling the contains()
can the iterator position in one call effect other one? Or are the iterators having different instances in these two thread calls?