code: func (s *lockBasedTxSimulator) SetPrivateDataMetadata(namespace, collection, key string, metadata map[string][]byte) error {
  	if err := s.helper.validateCollName(namespace, collection); err != nil {
  		return err
  	}
  	if err := s.checkWritePrecondition(key, nil); err != nil {
  		return err
  	}
  	s.rwsetBuilder.AddToHashedMetadataWriteSet(namespace, collection, key, metadata)
  	return nil
  }
docs: // SetPrivateDataMetadata implements method in interface `ledger.TxSimulator`