Scala: How to test the concurrency of a mutable.Set
问题 In Scala, both concurrent and non-concurrent Sets have exactly the same type: // A regular Set in Scala, not concurrent. val regularSet: mutable.Set[Int] = mutable.Set[Int]() // A concurrent set. It has the same type as a regular set, but underneath, it is actually concurrent. In my opinion, this is a flaw in the type system for Scala collections val concurrentSet: mutable.Set[Int] = java.util.concurrent.ConcurrentHashMap.newKeySet[Int]().asScala I'd like a way to actually test whether a set