This method internally use getXObjects(classReference) to get the actually list to add the provided object to except that the list returned by getXObjects(classReference) is just a new ArrayList<BaseObject>() stored nowhere when there is no object of this class...
Same things for:
- setXObject(DocumentReference classReference, int nb, BaseObject object)
- setXObject(int nb, BaseObject object)
I think getXObjects(DocumentReference) changed at some point and broke them since they are all broken because of a missunderstanding on how it's supposed to work: they all expect it to return null when there is no object of this class but it returns a new ArrayList (which makes a lots more sens than null since it should never return null, Collections#EMPTY_LIST would be event better but I have the crappy code is using getXObject(reference).add()...).