title: adding Integer objects to a hashSet
body: <p>Consider the following code:</p>
  
  <pre><code>6.  Set&lt;Integer&gt; set = new HashSet&lt;Integer&gt;();
  7.  Integer i1 = 45;
  8.  Integer i2 = 46;
  9.  set.add(i1);
  10. set.add(i1);
  11. set.add(i2); System.out.print(set.size() + " ");
  12. set.remove(i1); System.out.print(set.size() + " ");
  13. i2 = 47;
  14. set.remove(i2); System.out.print(set.size() + " ");
  15. System.out.println(set.contains(i2));
  </code></pre>
  
  <p>The code outputs:</p>
  
  <p><code>2 1 1 false</code></p>
  
  <p>After line 14 I assumed that the size would be <code>0</code> but it is <code>1</code>. I guess that a new object <code>i2</code> is added to the set at line 13, so I tested that at line 15 but it returns <code>false</code> (i.e no <code>i2</code> exists in the set), why is that?</p>