class AssertionMatcher<T> extends BaseMatcher<T> {
  private AssertionError firstError;

  /**
   * {@inheritDoc}
   */
  @SuppressWarnings("unchecked")
  @Override
  public boolean matches(Object argument) {<FILL_FUNCTION_BODY>}

  /**
   * Perform the assertions implemented in this method when the {@link AssertionMatcher} is used as an Hamcrest {@link Matcher}.
   *
   * If the matcher fails, the description will contain the stacktrace of the first failed assertion.
   * <p>
   * Example with Mockito:
   * <pre><code class='java'> verify(customerRepository).save(argThat(new AssertionMatcher&lt;Customer&gt;() {
   *     &#64;Override
   *     public void assertion(Customer actual) throws AssertionError {
   *       assertThat(actual).hasName(&quot;John&quot;)
   *                         .hasAge(30);
   *     }
   *   })
   * );</code></pre>
   *
   * @param actual assertion object
   * @throws AssertionError if the assertion object fails assertion
   */
  public abstract void assertion(T actual) throws AssertionError;

  /**
   * {@inheritDoc}
   */
  @Override
  public void describeTo(Description description) {
    if (firstError != null) {
      description.appendText("AssertionError with message: ");
      description.appendText(firstError.getMessage());
      description.appendText(String.format("%n%nStacktrace was: "));
      description.appendText(Throwables.getStackTrace(firstError));
    }
  }
}

    T actual = (T) argument;
    try {
      assertion(actual);
      return true;
    } catch (AssertionError e) {
      firstError = e;
      return false;
    }
  
<no_super_class>