Let's suppose I'm using a library for which I don't know the source code. It has a method that returns a List, like so:
public List<SomeObj> getObjs() { ... }
I'm wondering if this is a good idea:
ArrayList<SomeObj> objs = (ArrayList<SomeObj>) getObjs();
If, for example, the concrete implementation of the List inside getObjs() is a LinkedList
then wouldn't there be some kind of type discrepancy?