CompressedObjectReference addObject(CompressedObject obj) {
if (obj == null) {
throw new NullPointerException("obj must not be null");
}
CompressedObjectReference reference = new CompressedObjectReference(obj.getObjectNumber(),
getObjectNumber(), objects.size());
objects.add(obj);
return reference;
}