@Override
    public boolean equals(Object obj) {

        // Check if the other object is this exact object
        if (this == obj)
            return true;

        // Check if the other object is null
        if (obj == null)
            return false;

        // Check if the other object is also a UserLogin
        if (getClass() != obj.getClass())
            return false;

        // If the other object is also a UserLogin, it must
        // have the same username and domain
        UserLogin other = (UserLogin) obj;
        return Objects.equals(username, other.username)
                && Objects.equals(domain, other.domain);

    }
Create a new UserLogin instance with the provided username and
domain. The domain may be null, but the username should never be.

@param username
   The username to create the UserLogin instance with. This should
   never be null.

@param domain
   The domain to create the UserLogin instance with. This can be null.
extensions/guacamole-vault/modules/guacamole-vault-ksm/src/main/java/org/apache/guacamole/vault/ksm/secret/UserLogin.java