finalize method
Called by the RestorationManager just before the data of the bucket is serialized and send to the engine.
It is exposed to allow testing of RestorationBuckets in isolation.
Implementation
@visibleForTesting
void finalize() {
assert(_debugAssertNotDisposed());
assert(_needsSerialization);
_needsSerialization = false;
assert(_debugAssertIntegrity());
}