This is missing a (2010) tag.<p>Unexpected problem coming from a naïve "optimization". Shows that sometimes it's better to just leave code as simple as possible rather than implementing "clever" optimizations.<p>Especially in something so fundamental as the base class for all Sets in the collections framework.