This does not compile, any suggestion appreciated.
... List list = getList(); return (List) list;
Compil
You can use a double cast.
return (List) (List) getList();