update the WeakHashSet version with the most current one in Scala