title: How to solve warning Unchecked cast android studio?
body: <p>I have warning:</p>
  
  <pre><code>Unchecked cast: Serializable! to kotlin.collections.HashMap&lt;String, String&gt; /* = java.util.HashMap&lt;String, String&gt; */
  </code></pre>
  
  <p>at this place:</p>
  
  <pre><code>filterData = bundle.getSerializable("filter_data") as HashMap&lt;String, String&gt;
  </code></pre>
  
  <p>I <a href="https://stackoverflow.com/questions/51805648/unchecked-cast-java-io-serializable-to-java-util-arraylist">saw</a> this question and <a href="https://stackoverflow.com/questions/49209150/kotlin-unchecked-cast-any-to-hashmapstring-string">this</a> one but I didn't manage to solve my problem. I have to get data by bundle at fragments. Maybe someone had similar problem and knows how to solve it?</p>
  
  <h2>UPDATE</h2>
  
  <p>I have this global variable:</p>
  
  <pre><code> var filterData: HashMap&lt;String, String&gt; = HashMap()
  </code></pre>
  
  <p>how I receive it due to comments and answers:</p>
  
  <pre><code> when {
         bundle.containsKey("filter_data") -&gt; {
         val serializable = bundle.getSerializable("filter_data")
         if(serializable is java.util.HashMap&lt;*, *&gt;){
           filterData = bundle.getSerializable("filter_data") as HashMap&lt;String, String&gt;
           Singleton.filter_data = filterData
           getJobList(offset, type, sp.getString("access_token", ""), bundle.getSerializable("filter_data") as HashMap&lt;String, String&gt;, false)
           }
  
        }
  ....
  }
  </code></pre>
  
  <p>and I have this <code>as HashMap&lt;String, String&gt;</code> part yellow and warning:</p>
  
  <pre><code>Unchecked cast: Serializable! to kotlin.collections.HashMap&lt;String, String&gt; /* = java.util.HashMap&lt;String, String&gt; */
  </code></pre>