title: Safe cast to hash map
body: <p>How can I safely cast a Map to a hash Map?</p>
  
  <p>I want to avoid class cast exception</p>
  
  <pre><code>HashMap&lt;String, String&gt; hMap;
  
  public void setHashMap(Map map){
      hMap = (HashMap&lt;String, String&gt;) map;
  }
  </code></pre>