For example, lets say you have two classes:
public class TestA {}
public class TestB extends TestA{}
I have a method that returns a L
Quite strange that manually casting a list is still not provided by some tool box implementing something like:
@SuppressWarnings({ "unchecked", "rawtypes" })
public static List cast(List list) {
return (List) list;
}
Of course, this won't check items one by one, but that is precisely what we want to avoid here, if we well know that our implementation only provides the sub-type.