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

    LdapUserDto that = (LdapUserDto) o;

    if (userName != null ? !userName.equals(that.getUserName()) : that.getUserName() != null) return false;

    return true;
  }
Set the DN.

@param dn the DN
ambari-server/src/main/java/org/apache/ambari/server/security/ldap/LdapUserDto.java