public void mergePrincipals(ResolvedKerberosKeytab otherKeytab) {
    for (ResolvedKerberosPrincipal rkp : otherKeytab.getPrincipals()) {
      ResolvedKerberosPrincipal existent = findPrincipal(rkp.getHostId(), rkp.getPrincipal(), rkp.getKeytabPath());
      if (existent != null) {
        existent.mergeComponentMapping(rkp);
      } else {
        principals.add(rkp);
      }
    }
  }
Merge principals from one keytab to given.

@param otherKeytab keytab to merge principals from
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/stageutils/ResolvedKerberosKeytab.java