As per a literature I read,we have juicy fruits implementign the following interface:
public interface Juicy<T> {
Juice<T> squeeze();
}
Using bounded type variables, following method would taks a bunch of fruits and squeeze them all:
<T extends Juicy<T>> List<Juice<T>> squeeze(List<T> fruits);
Now we need lower siblings as below to work too:
class Orange extends Fruit implements Juicy<Orange>;
class RedOrange extends Orange;
So I would expect the method to look as follows:
<T extends Juicy<T>> List<Juice<? super T>> squeeze(List<? extends T> fruits);
Instead I find the method signature to be as below:
<**T extends Juicy<? super T>>** List<Juice<? super T>> squeezeSuperExtends(List<? extends T> fruits);
What explains this difference?