title: Compare two objects excluding some fields - Java
body: <p>I need to compare two objects of the same class excluding some fields.</p>
  <pre><code>public final class Class1 {
    private String a;
    private String b;
    private String c;
  :
  :
  :
  
    private String z;
    private Date createdAt; 
    private Date updatedAt; 
  } 
  </code></pre>
  <p>How can i find if the two objects of the above class are equal excluding createdAt and updatedAt values? Since there are a lot of fields in this class, i don't want to compare each of them one by one.</p>
  <p>Please don't give AssertJ's recursive comparison solution as I don't need it for UnitTests.</p>
  <p>Thank you in Advance!</p>