title: why no replace() method defined on the Set interface?
body: <p>Currently I have to write the following to update an element already contained in a Set:</p>
  
  <pre><code>Set mySet= ...
  Element e1 = new Element (...);
  ....
  ....
  Element e2 = new Element (...);
  \\e1 and e2 are different instances, but equals.
  
  \\update the element contained into the Set
  if (mySet.contains(e2)){
      mySet.remove(e2);
      myset.add(e2);
   }
  </code></pre>
  
  <p>That doesnt look nice. Is there an alternative ?</p>