List<DBObject> casting to List<Category>
<p>I have a super class <code>DBAdapter</code>, it have method <code>fetchAll()</code> which selects all records from the table of the DB to <code>List&lt;DBObject&gt;</code>. I have inherit this class with <code>CategoryDBAdapter</code>, this class knows about class <code>Category</code> extended from <code>DBObject</code>.</p>

<p>When I call:</p>

<pre><code>CategoryDBAdapter categoryDbAdapter = new CategoryDBAdapter(dbHelper);

List&lt;Category&gt; categories = categoryDbAdapter.fetchAll();
</code></pre>

<p>my code can't cast <code>List&lt;DBObject&gt;</code> to the <code>List&lt;Category&gt;</code>. What is the common used way to resolve this collision?</p>
