在这里,https ://github.com/junit-team/junit/wiki/Assertions ,看看:
public void testAssertThatHamcrestCoreMatchers() {
assertThat("good", allOf(equalTo("good"), startsWith("good")));
assertThat("good", not(allOf(equalTo("bad"), equalTo("good"))));
assertThat("good", anyOf(equalTo("bad"), equalTo("good")));
assertThat(7, not(CombinableMatcher.<Integer> either(equalTo(3)).or(equalTo(4))));
assertThat(new Object(), not(sameInstance(new Object())));
}
在第 5 行,CombinableMatcher.<Integer>
有效吗?我用java6试了一下,失败了。是新语法还是简单的错字?