title: Why equals and hashCode were defined in Object?
body: <p>What's the reasoning behind decision to include these methods in the java.lang.Object? Equality and hashing doesn't make sense for many classes.</p>
  
  <p>It would be more logical to make two interfaces:</p>
  
  <pre><code>interface Equalable {
      boolean equals(Equalable other);
  }
  
  interface Hashable extends Equalable {
      int hashCode();
  }
  </code></pre>
  
  <p>For example HashSet definition might look like</p>
  
  <pre><code>class HashSet&lt;T extends Hashable&gt; ...
  </code></pre>
  
  <p>It would prevent one of the common beginner mistakes - using set of items without implementing equals/hashCode.</p>