title: HashMap values().equals() is always return false even if comparing with another HashMap which has same value
body: <p>I am trying to check whether values of two hashmaps are equal to each other or not with using hashMap.values().equals(). But even if two HashMap have same values it's not considered as equal.</p>
  
  <pre><code>String s = "egg";
  String t = "add";
  int count = 0;
  HashMap&lt;String,Integer&gt; hashMap = new HashMap&lt;&gt;();
  
  for (int i = 0; i &lt; s.length(); i++) {
      String val = String.valueOf(s.charAt(i));
  
      if (!hashMap.containsKey(val)) {
          count++;
          hashMap.put(val, count);
      } else {
          hashMap.put(val, hashMap.get(val));
      }
  }
  
  HashMap&lt;String,Integer&gt; hashMap2 = new HashMap&lt;&gt;();
  int count2 = 0;
  for (int j = 0; j &lt; t.length(); j++) {
      String val = String.valueOf(t.charAt(j));
  
      if (!hashMap2.containsKey(val)) {
          count2++;
          hashMap2.put(val, count2);
      } else{
          hashMap2.put(val, hashMap2.get(val));
      }
  }
  
  if (hashMap.values().equals(hashMap2.values())) {
      return true;
  } else {
      return false;
  }
  </code></pre>