title: Define unicity criteria when declaring java.util.Set
body: <p>Say that we have a class <code>MyClass</code> that does not override <code>equals/hashcode</code> but we want to use it in a <code>java.util.Set</code>. Is it possible to define an <code>equals</code> criteria at the <code>Set</code> declaration? The goal is to accept only one object from <code>MyClass</code> which respect the defined criteria. I know that we can check if the object does not exist before adding it but it's a bit tedious and we lose the interest of using a <code>Set</code></p>