Extending Java default collections is not considered good practice. But i am wondering if, for the sake of cleaner code, one would not extend, say ArrayList to get rid of the generic. For example
public class DoodleList extends ArrayList<Doodle> {
/**
*
*/
private static final long serialVersionUID = 1L;
}
So that in one's code you do some thing like "someFramework.getContentAs(DoodleList.class)" without having those nasty warnings about generics...etc
NOTE Wrapping the List might not be an option in my case : the class is to be used in JSON mapping where the desired output is :
{doodles : [doodle1,doodle2,doodle3]}
not {doodles : {innerCollection : [doodle1,doodle2,doodle3]}}