Altering hashCode of object inside of HashSet / HashMap
<p>I am relatively new to Java and am puzzled about the following thing:  I usually add objects to an <code>ArrayList</code> before setting its content.  I.e.,</p>

<pre><code>List&lt;Bla&gt; list = new ArrayList&lt;&gt;();
Bla bla = new Bla();
list.add(bla);
bla.setContent(); // content influences hashCode
</code></pre>

<p>This approach works great.  I am concerned whether this approach will give me trouble when used with <code>HashSet</code>s or <code>HashMap</code>s.  The internal hash table get set at the time the object is added.  What will happen if <code>setContent()</code> gets called after the object was added to <code>HashSet</code> or <code>HashMap</code> (and its hashCode changes)?</p>

<p>Should I fully set the (hashCode influencing) content <em>before</em> adding / putting into <code>HashSet</code>s or <code>HashMap</code>s?  Is it generally recommended to finish building objects before adding them?</p>

<p>Thank you very much for your insights.</p>