code: func referencesDiffs(old []metav1.OwnerReference, new []metav1.OwnerReference) (added []metav1.OwnerReference, removed []metav1.OwnerReference, changed []ownerRefPair) {
  	oldUIDToRef := make(map[string]metav1.OwnerReference)
  	for _, value := range old {
  		oldUIDToRef[string(value.UID)] = value
  	}
  	oldUIDSet := sets.StringKeySet(oldUIDToRef)
  	newUIDToRef := make(map[string]metav1.OwnerReference)
  	for _, value := range new {
  		newUIDToRef[string(value.UID)] = value
  	}
  	newUIDSet := sets.StringKeySet(newUIDToRef)
  
  	addedUID := newUIDSet.Difference(oldUIDSet)
  	removedUID := oldUIDSet.Difference(newUIDSet)
  	intersection := oldUIDSet.Intersection(newUIDSet)
  
  	for uid := range addedUID {
  		added = append(added, newUIDToRef[uid])
  	}
  	for uid := range removedUID {
  		removed = append(removed, oldUIDToRef[uid])
  	}
  	for uid := range intersection {
  		if !reflect.DeepEqual(oldUIDToRef[uid], newUIDToRef[uid]) {
  			changed = append(changed, ownerRefPair{oldRef: oldUIDToRef[uid], newRef: newUIDToRef[uid]})
  		}
  	}
  	return added, removed, changed
  }
docs: // TODO: profile this function to see if a naive N^2 algorithm performs better
  // when the number of references is small.