How do I make these line of codes more scala-ish (shorter?). I still get the Java feeling in it (which I want to stay away from).import scala.collection.mutableval outstandingUserIds: mutable.LinkedHashSet[String] = mutable.LinkedHashSet[String]()    val tweetJson = JacksMapper.readValue[Map[String, AnyRef]](body)     val userObj = tweetJson.get(user)    tweetJson.get(user).foreach(userObj => {  userObj.asInstanceOf[Map[String, AnyRef]].get(id_str).foreach(idStrObj => {    if (outstandingUserIds.exists(outstandingIdStr => outstandingIdStr.equals(idStrObj))) {      outstandingUserIds.remove(idStrObj.asInstanceOf[String])    }  })})
Parsing JSON to a Map and Set structure
scala;json
If you really want to inflict this JSON library on yourself, your code could be simplified to:import scala.collection.mutableval outstandingUserIds = mutable.LinkedHashSet[String]()    val tweetJson = JacksMapper.readValue[Map[String, AnyRef]](body)     for {  userObj <- tweetJson.get(user)  idStrObj <- userObj.asInstanceOf[Map[String, AnyRef]].get(id_str)} outstandingUserIds -= idStrObj.asInstanceOf[String]But I would recommend you use a better JSON library. For example, using the library that comes with the Play! framework:(body \ user \ id_str).asOpt[String].foreach {id =>  outstandingUserIds -= id}