I can't figure out how to write this correctly so it will not generate compiler errors:
class AnElement implements IElement { ... }
protected ArrayList<AnElement> someElements() {
...
}
protected ArrayList<IElement> elements() {
return (ArrayList<IElement>) someElements(); // this doesn't work...
// return someElements(); // ... neither does this
}
What's the correct way to do this?