Método simulado con genérico y se extiende en el tipo de retorno
¿Es posible simularse (con mockito) el método con firma?Set<? extends Car> getCars()
sin supresar las advertencias? Lo intenté:
XXX cars = xxx;
when(owner.getCars()).thenReturn(cars);
pero no importa como lo declarocars
Siempre me sale un error de compilación. por ejemplo, cuando declaro así
Set<? extends Car> cars = xxx
Me sale el error de compilación genérico / mockito estándar
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>)