It would be better if you import `scala.collection.mutable` and use `mutable.HashSet` and `mutable.HashMap`. Again, this is not related to this PR ...