title: Getting an element from a Set
body: <p>Why doesn't <code>Set</code> provide an operation to get an element that equals another element?</p>
  
  <pre><code>Set&lt;Foo&gt; set = ...;
  ...
  Foo foo = new Foo(1, 2, 3);
  Foo bar = set.get(foo);   // get the Foo element from the Set that equals foo
  </code></pre>
  
  <p>I can ask whether the <code>Set</code> contains an element equal to <code>bar</code>, so why can't I get that element? :(</p>
  
  <p>To clarify, the <code>equals</code> method is overridden, but it only checks one of the fields, not all. So two <code>Foo</code> objects that are considered equal can actually have different values, that's why I can't just use <code>foo</code>.</p>