static void fail(@Nullable Object actualValue, Matcher<?> matcher) {
    Description description =
        new StringDescription()
            .appendText("\nExpected: ")
            .appendDescriptionOf(matcher)
            .appendText("\n     but: ");
    matcher.describeMismatch(actualValue, description);
    AssertionError assertionError = new AssertionError(description.toString());
    assertionError.setStackTrace(ObjectChecker.trimStackTrace(assertionError.getStackTrace()));
    throw assertionError;
  }
The match wrapper.
@param <T> the generic type
testing/src/org/immutables/check/ObjectChecker.java