title: Implementation equals() method design pattern
body: <p>Is there any design pattern (or idiom) that helps to implement <code>equals()</code> method in Java? <br><br> That task is'n so hard but in most cases it's about the same... That's why I guess that there is a pattern but I didn't find it.</p>
  
  <pre><code>UPDATE
  </code></pre>
  
  <p>I chose the method: <code>generate equals() method in Eclipse</code> but... I found a good way (in AbstractList) to make that generated code better: </p>
  
  <pre><code>if (!(attributes ==null ? other.attributes==null : attributes.equals(other.attributes))) 
      return false; 
  </code></pre>
  
  <p>instead of generated:</p>
  
  <pre><code>if (attributes == null) {
          if (other.attributes != null)
          return false;
      } else if (!attributes.equals(other.attributes))
          return false;
  </code></pre>