title: HashMap< HashMap<String,Integer>, Integer > keeping track of sets
body: <p>I'm generating HashMap and I want to keep track of how many HashMaps of each kind I am generating by putting them in another HashMap&lt; HashMap&lt; String,Integer >, Integer > where the value is the frequency. </p>
  
  <p>My code looks like this: </p>
  
  <pre><code>HashMap&lt; HashMap&lt;String,Integer&gt;,Integer&gt; myHashmaps = new HashMap&lt; HashMap&lt;String,Integer&gt; , Integer&gt;();
  for(int i = 0; i &lt; 200; i++){
      HashMap&lt;String, Integer&gt; generatedMap = generateHashMap();
      if(myHashmaps.containsValue(generatedMap)){
           sets.put(generatedMap, myHashmaps.get(generatedMap) + 1 );
      }else{
           myHashmaps.put(generatedMap,1 );
      }
  }
  </code></pre>
  
  <p>After the end of the loop, I will print the most frequently occuring hashmap from myHashmaps. </p>
  
  <p>The issue I am having is that generated hashmaps with the same keys and sets are showing up in myHashmaps multiple times. What am I missing? </p>