Comparing Two Hashmaps in Java : <p>What's the recommended approach for comparing hashmaps in Java for equality so that I can determine if they have identical keys and values?</p>

<pre><code>Map&lt;String,List&lt;String&gt;&gt; data1 = new HashMap&lt;&gt;();
data1.put("file1", Arrays.asList("one","two","three"));

Map&lt;String,List&lt;String&gt;&gt; data2 = new HashMap&lt;&gt;();
data2.put("file1", Arrays.asList("one","two","three"));
</code></pre>
