Ok, so here is my problem:
I have a list containing interfaces - List
- and a list of interfaces that extend that interface: Li
There's no way to do it that is type safe.
A List
cannot have arbitrary Interface
s added to it. It is a list of SubInterface
s after all.
If you are convinced that this is safe to do even though it is not type safe you can do
@SuppressWarnings("unchecked")
void yourMethodName() {
...
List a = (List) b;
...
}