public interface Store<T> {
Optional<List<? extends T>> method1();
}
public StoreImpl<R extends SomeType> implements Store<SomeType> {
@Override
public Optional<List<R>> method1() {
Optional<List<R>> toReturn = Optional.empty();
:
toReturn = somePrivateMethodReturningListOfR();
:
return toReturn;
}
}
Compiler cribs reporting incompatible return types for method1() between the interface and concrete implementation.
What am I missing here ?