title: How to compare lists of custom classes without defining equals() and hashCode()?
body: <p>Since defining <code>equals()</code> and <code>hashCode()</code> only for testing purpose is considered as a code smell, I prefer to use <code>ReflectionEquals</code> or custom matchers to compare objects while doing unit testing.</p>
  
  <p>However, I don't know how to use <code>ReflectionEquals</code> or custom matchers in comparing lists of user-defined classes.</p>
  
  <p>For example, how do I assert the following code without defining <code>equals()</code> and <code>hashCode()</code> (maybe only use <code>ReflectionEquals</code> or custom matchers)?</p>
  
  <pre class="lang-java prettyprint-override"><code>// When
  List&lt;Record&gt; actual = sut.findBySomeId();
  
  // Then
  List&lt;Record&gt; expected = asList(
      aRecord()...build(), 
      aRecord()...build()
  );
  assertThat(expected, /* how to compare? */);
  </code></pre>