toJson method
Encodes ownership independently of allocator implementation.
Implementation
Map<String, Object?> toJson() => {
'kind': kind,
'version': version,
'capacity': capacity,
'allocatedIndices': allocatedIndices.toList()..sort(),
};