title: Create a list with empty map
body: <p>I have a JSON string which is parsed and a typecaseted to a <code>map</code>. I'm using this map to get a <code>List[Map[String, Any]]</code>. Here to make my code error free I have used <code>getOrElse</code> while type casting.</p>
  
  <p>JSON string looks similar to </p>
  
  <pre><code>{
    "map-key" : [
       {
         "list-object-1-key" : "list-object-1-value"
       },
       {
         "list-object-2-key" : "list-object-2-value"
       }, 
    ]
  } 
  </code></pre>
  
  <p>My code</p>
  
  <pre><code>val json = JSON.parseFull(string) match {
      case Some(e) =&gt;
            val list = e.asInstanceOf[Map[String, Any]]
                    .getOrElse("map-key", List[Map[String,Any]]) // Error here
            val info = list.asInstanceOf[List[Map[String, Any]]]
            //iterate over each element in the list and perform my operations
     case None =&gt; string
  }
  </code></pre>
  
  <p>I can understand that whenever there is no result present in <code>list</code> object then <code>info</code> object is repeated code. </p>
  
  <p>How can I improve this programme by giving the default value to <code>list</code> object?</p>