protected void updateKerberosDescriptorIdentityReferences(Map<String, ? extends AbstractKerberosDescriptorContainer> descriptorMap,
                                                          String referenceName,
                                                          String newReferenceName) {
    if (descriptorMap != null) {
      for (AbstractKerberosDescriptorContainer kerberosServiceDescriptor : descriptorMap.values()) {
        updateKerberosDescriptorIdentityReferences(kerberosServiceDescriptor, referenceName, newReferenceName);

        if (kerberosServiceDescriptor instanceof KerberosServiceDescriptor) {
          updateKerberosDescriptorIdentityReferences(((KerberosServiceDescriptor) kerberosServiceDescriptor).getComponents(),
              referenceName, newReferenceName);
        }
      }
    }
  }
Iterates through a collection of AbstractKerberosDescriptorContainers to find and update
identity descriptor references.

@param descriptorMap    a String to AbstractKerberosDescriptorContainer map to iterate trough
@param referenceName    the reference name to change
@param newReferenceName the new reference name
ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java