title: Java setters for returned object
body: <p>I have a question regarding setters for a returned object. 
  I have a class with a private HashMap and a get method. The HashMap contains Minions (a class also having private values with getters and setters) as values. 
  When I now do</p>
  
  <pre><code>Minion testMinion = MyClass.getMinion(somestuffhere);
  testMinion.setLevel(9);
  </code></pre>
  
  <p>Does only the level of the variable testMinion change so I'd have to update the HashMap with the new Minion or does this modify the original Minion in the HashMap since testMinion is just a reference to it?</p>