private KerberosDescriptor combineKerberosDescriptors(KerberosDescriptor stackDescriptor, KerberosDescriptor userDescriptor) {
    KerberosDescriptor kerberosDescriptor;
    if (stackDescriptor == null) {
      if (userDescriptor == null) {
        return new KerberosDescriptor();  // return an empty Kerberos descriptor since we have no data
      } else {
        kerberosDescriptor = userDescriptor;
      }
    } else {
      if (userDescriptor != null) {
        stackDescriptor.update(userDescriptor);
      }
      kerberosDescriptor = stackDescriptor;
    }

    return kerberosDescriptor;
  }
Combines a stack-level Kerberos descriptor with a user-suppled Kerberos descriptor to creae a
composite {@link KerberosDescriptor} using the following logic:
<p>
<ul>
<li>
If both the stack-level and the user-supplied Kerberos descriptors are <code>null</code>,
return an empty {@link KerberosDescriptor}.
</li>
<li>
If the stack-level Kerberos descriptor is <code>null</code> and the user-supplied Kerberos
descriptor is <code>non-null</code>, return the user-supplied Kerberos descriptor.
</li>
<li>
If the stack-level Kerberos descriptor is <code>non-null</code> and the user-supplied
Kerberos descriptor is <code>null</code>, return the stack-level Kerberos descriptor.
</li>
<li>
If neither the stack-level nor the user-supplied Kerberos descriptors are <code>null</code>,
return the stack-level Kerberos descriptor that has been updated using data from the
user-supplied Kerberos descriptor.
</li>
</ul>

@param stackDescriptor the stack-level Keberos descriptor
@param userDescriptor  the user-supplied Kerberos descriptor
@return a KerberosDescriptor
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java