I'm not sure what the technical term for this is, but consider an interface:
public interface SomeInterface<T> {
public T doSomething();
}
And then a second interface:
public interface SomeRelatedInterface<T, D extends SomeInterface<T>> {
public T doSomethingRelated(D relative);
}
Is it possible to craft the second interface to only require one generic parameter, and then have the doSomethingRelated method implicitly extract the return type in its declaration. This is not legal, but this is what I am wondering if can be done in some other means:
public interface <T> SomeRelatedInterface<D extends SomeInterface<T>> {
public T doSomethingRelated(D relative);
}
EDIT (On posting the bounty): At this point what I am looking for on this question is the reason that the language requires this duplication. That is what has been missing from the answers until now to get one accepted.