1
我有我創建了一個客戶匹配如下:編譯麻煩與Matchers.allOf
private static class FromResidualAllocationMatcher extends BaseMatcher<FromResidualAllocation> {....}
在我的測試類創建這些匹配的列表:
List<FromResidualAllocationMatcher> matchers = Lists.newArrayList();
// create list elements
我他們嘗試如下創建匹配:
Matchers.allOf(matchers)
我希望能呼籲org.hamcr以下重載方法avalialbe est.Matchers:
public static <T> org.hamcrest.Matcher<T> allOf(org.hamcrest.Matcher<? super T>... param1) {
return org.hamcrest.core.AllOf.<T>allOf(param1);
}
編譯器給了我以下錯誤:
The method allOf(Matcher<? super T>...) in the type Matchers is not applicable for the arguments (List<ResidualAllocationServiceImplTest.FromResidualAllocationMatcher>)
如何需要定義我BaseMatcher實施,得到這個工作?