Для установки:
scala> val bf = ArrayBuffer(1,2,3,4)
bf: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer(1, 2, 3, 4)
scala> bf.toSet
res0: scala.collection.immutable.Set[Int] = Set(1, 2, 3, 4)
К HashSet:
scala> val hs = new HashSet[Int]++ bf.toSet
hs: scala.collection.immutable.HashSet[Int] = Set(1, 2, 3, 4)