1
我在这里错过了什么吗?Hamcrest的任何东西()不编译
@Test
public void testAnything(){
Random random = new Random();
assertThat(random.nextInt(), is(equalTo(anything())));
}
这不能编译。 Eclipse会抱怨:“MatcherAssert类型中的方法assertThat(T,Matcher)不适用于参数(int,Matcher>)”
是否有我错过了使用任何()的东西?过去我使用过其他Hamcrest方法......所以这有什么不同?