title: Custom matchers with different object
body: <p>Hi I am writing a custom matcher to validate two different object, and my code is:</p>
  
  <pre><code>public class DetailsMatcher extends ArgumentMatcher &lt;Details&gt; {
  
      private final Details expected;
  
      private DetailsMatcher(Details expected) {
          this.expected = expected;
      }
  
      @Override
      public boolean matches(Object actual) {
          return ((Request) actual).getId().equals(expected.getId());
      }
  
      @Override
      public void describeTo(Description description) {
          description.appendText(expected == null ? null : expected.toString());
      }
  
      public static Details valueObjectEq(Details expected) {
          return argThat(new DetailsMatcher(expected));
      }
  }
  </code></pre>
  
  <p>And I want to use it in my test as:</p>
  
  <pre><code>assertThat(requestModel, DetailsMatcher.valueObjectEq(response));
  </code></pre>
  
  <p>But these are two different object so that it doesn't work. I don't want to change my objects just for testing purpose, so do we have some api like assertThat, which allows passing different object to simply relies on the output of matches, rather than forcing the actual and expected of same type?</p>