我想使用Hamcrest的hasItems和一个“实际”集合,它是一个ArrayList<?扩展SomeInterface>
上
assertthat(ArrayList extends SomeInterface>,hasItems(InstanceOfSomeInterface))
编译器说:
The method
assertthat(T,Matcher
in the type Assert
is not applicable for the arguments(ArrayList
terable
出了什么问题?我该怎么办(我真的想在这里使用Hamcrest)?
最佳答案
ArrayListassertthat(newList,hasItems(InstanceOfSomeInterface));
不幸的是Assert.assertthat没有编码使用?超级还是?扩展到允许你描述的内容.