Adding a state check as per COLLECTIONS-3. I got an NPE when running through tests without synchronization