title: How to change HashMap<K, V> value type from Object to String?
body: <p>What is the easiest/best way to convert</p>
  
  <pre><code>Map&lt;String, Object&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>HashMap&lt;String, String&gt;
  </code></pre>
  
  <p>The API I am using has methods that return a Map but it would be easier if I didn't have to cast the Object to a String each time.</p>
  
  <p>Also, is this even worth doing? Would a HashMap be faster/more efficient than a Map?</p>
  
  <p>I'm assuming I'll have to loop through the original Map and copy the values to the new HashMap.</p>
  
  <p>Thanks in advance!</p>