When creating a Map in scala, I call Map(entities.map{e => e.id -> e}), and I get:
Map
Map(entities.map{e => e.id -> e})
found : scala.collection.mutable.Indexed
Or this should work too:
entities.map{e => e.id -> e} toMap