Sorry, I thought this was an inheritance question: it was an ArrayList question all along!
Ok, my problem is more specific than I thought. So I have two families of
As stated, you cannot cast ArrayList to ArrayList, but you can cast ArrayList to ArrayList extends Card>. Or better use List extends Card> as your return value, because you probably don't rely on the ArrayList implementation anyway:
protected ArrayList extends Card> getCardBox();
As for your question in the comment, the construction should work as you described: List extends Card> list = new ArrayList. You probably have to fill your list, so the method is probably something like this:
protected ArrayList extends Card> getCardBox() {
List list = new ArrayList();
list.add(pokerCard1);
list.add(pokerCard2);
return java.util.Collections.unmodifiableList(list);
}