title: How to compare two Objects in Java that also have lists in its properties
body: <pre><code>public class Employee{
  
  int empId;
  String empName;
  List &lt;EmployeeAddress&gt; empAdd;
  
  // getters &amp; setters
  
  }
  
  public class EmployeeAddress{
  String city;
  String state;
  
  // getters &amp; setters
  
  }
  </code></pre>
  
  <p>now I make two objects of employee class, and want to compare them. I have used list in the employee class since employee can have multiple addresses. Need help on this</p>