* @param actual the value to match against
* @param matcher the matcher
*/
public static <T> void assertThat(String reason, T actual, Matcher<T> matcher) {
if (!matcher.matches(actual)) {
Description description = new StringDescription();
description.appendText(reason);
description.appendText("\nExpected: ");
description.appendDescriptionOf(matcher);
if (describeMismatchMethod != null) {
description.appendText("\n but: ");
// matcher.describeMismatch(actual, description);
ReflectionUtils.invokeMethod(describeMismatchMethod, matcher, actual, description);
}
else {
description.appendText("\n got: ");
description.appendValue(actual);
description.appendText("\n");
}
throw new AssertionError(description.toString());
}
}