【发布时间】:2014-12-16 04:04:29
【问题描述】:
即使我知道 foo 不为空,此断言也可以编译但失败:
import static org.hamcrest.Matchers.is; // see http://stackoverflow.com/a/27256498/2848676
import static org.hamcrest.Matchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
...
assertThat(foo, is(not(null)));
【问题讨论】: