private final String msg;
@Override
public void is(Matcher<? super T> matching) {
Description message = new StringDescription();
message.appendText("expecting ");
matching.describeTo(message);
message.appendText(" but ");
T obj = provider.get();
if (!matching.matches(obj)) {
matching.describeMismatch(obj, message);
if (assertion) {
throw new AssertionError((msg == null ? "" : msg + "\n")
+ message.toString());
} else {
throw new AssumptionError((msg == null ? "" : msg + "\n")
+ message.toString());
}
}
}