let's have this
MyClass implements MyInterface
now I cannot write:
Iterator<MyInterface> iter;
Iterator<MyClass> iter2 = ..... ;
iter = iter2 ;// DOES NOT COMPILE : INVARIANCE PRINCIPLE
hey... wait a minute are we really breaking type safety by doing that?
I suspect not ...
I even suspect that rules such as : "if a parameterized interface uses its parameters only in the return type of methods then the invariance principle does not apply" could be true (in principle though not in implementation)...
I may be wrong .... your advice? any counter-example to satisfy me?
going further I think it should be legal to write this:
Iterable<MyInterface> iter = iterableMyClass ;