How should lists be cast to their conrecte implementations?
<p>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:</p>

<pre><code>public List&lt;SomeObj&gt; getObjs() { ... }
</code></pre>

<p>I'm wondering if this is a good idea:</p>

<pre><code>ArrayList&lt;SomeObj&gt; objs = (ArrayList&lt;SomeObj&gt;) getObjs();
</code></pre>

<p>If, for example, the concrete implementation of the List inside getObjs() is a <code>LinkedList</code> then wouldn't there be some kind of type discrepancy?</p>
