docs: final Collection<ServiceNamespace> retainAndGetNamespaces() {
          PartitionReplicationEvent event = new PartitionReplicationEvent(partitionId, 0);
          Collection<FragmentedMigrationAwareService> services = nodeEngine.getServices(FragmentedMigrationAwareService.class);
  
          Set<ServiceNamespace> namespaces = new HashSet<>();
          for (FragmentedMigrationAwareService service : services) {
              Collection<ServiceNamespace> serviceNamespaces = service.getAllServiceNamespaces(event);
              if (serviceNamespaces != null) {
                  namespaces.addAll(serviceNamespaces);
              }
          }
          namespaces.add(NonFragmentedServiceNamespace.INSTANCE);
  
          PartitionReplicaManager replicaManager = partitionService.getReplicaManager();
          replicaManager.retainNamespaces(partitionId, namespaces);
          return replicaManager.getNamespaces(partitionId);
      }