How to correctly use Contains on a java List holding HashMaps
<p>How can I use <code>contains</code> method on a list that contains <code>HashMaps</code> so that it returns true when I ask whether or not the list contains a specified <code>HashMap</code></p>

<p>For Example:</p>

<pre><code>    List ssibenefit = new ArrayList();
    HashMap map = new HashMap();
    map.put("one", "1");
    ssibenefit.add(map);
    HashMap map4 = new HashMap();
    map4.put("one", "1");

    System.out.println("size: " + ssibenefit.size());
    System.out.println("does it contain orig: " + ssibenefit.contains(map));
    System.out.println("does it contain new: " + ssibenefit.contains(new HashMap().put("one", "1")));
</code></pre>

<p>should return:</p>

<pre><code>size: 1
does it contain orig: true
does it contain new: true
</code></pre>

<p>but in this case the actual output is</p>

<pre><code>size: 1
does it contain orig: true
does it contain new: false
</code></pre>

<p><strong>Update</strong></p>

<p>Sorry, I've updated the question. As I was posting the question, I realized what I wanted to do and what I was asking were not the same thing. </p>
