title: Java: Selective comparison of two sets
body: <p>I am writing a lot of unit tests that do similar things with but with different classes.</p>
  
  <p>I want to compare Sets of the same class.  The class specifies an id property.  In set A this property is all null.  In Set B this property is set.  (Set B has been persisted to a database and uids have been populated).  </p>
  
  <p>For my unit test I want to make sure that Set A matches Set B and I obviously don't want it to look at the id field.</p>
  
  <p>What is the most efficient, clean and DRY way of doing this?</p>