Is there any \"good\" code pattern for a Class initializing and populating private mutable Maps, and then exposing them as immutable ones? Or should I just eter
scala> class X {
| private val mb = collection.immutable.Map.newBuilder[String, Int]
| def m = mb.result
| mb += ("a" -> 1) // stuff
| }
defined class X
scala> new X().m
res0: scala.collection.immutable.Map[String,Int] = Map(a -> 1)