You declared box as a List of what extends Collection from Object . But, according to the Java compiler, it could be anything that extends Collection , i.e. List<Vector<Object>> . Therefore, it must prohibit add operations that take a generic type parameter for this reason. It cannot allow you to add an ArrayList<Object> to a List , which may be List<Vector<Object>> .
Try removing the wildcard:
private List<Collection<Object>> box;
This should work because you can add an ArrayList<Object> to the List from the Collection<Object> .
rgettman
source share