抑制警告なしで署名付きの(mockitoを使用した)メソッドをモックすることは可能Set<? extends Car> getCars()
ですか?私は試した:
XXX cars = xxx;
when(owner.getCars()).thenReturn(cars);
しかし、どのように宣言してもcars
、常にコンパイルエラーが発生します。例えば私がこのように宣言するとき
Set<? extends Car> cars = xxx
標準のgeneric/mockitoコンパイルエラーが発生します
The method thenReturn(Set<capture#1-of ? extends Car>) in the type OngoingStubbing<Set<capture#1-of ? extends Car>> is not applicable for the arguments (Set<capture#2-of ? extends Car>)