@Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }

      Principal principal1 = (Principal) o;

      return components.equals(principal1.components) &&
          principal.equals(principal1.principal) &&
          !(realm != null ?
              !realm.equals(principal1.realm) :
              principal1.realm != null);

    }
Get the associated realm.

@return the associated realm
ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java