class StaticRedisCredentials implements RedisCredentials {

    private final String username;

    private final char[] password;

    StaticRedisCredentials(String username, char[] password) {
        this.username = username;
        this.password = password != null ? Arrays.copyOf(password, password.length) : null;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public boolean hasUsername() {
        return username != null;
    }

    @Override
    public char[] getPassword() {
        return hasPassword() ? Arrays.copyOf(password, password.length) : null;
    }

    @Override
    public boolean hasPassword() {
        return password != null;
    }

    @Override
    public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

    @Override
    public int hashCode() {
        int result = username != null ? username.hashCode() : 0;
        result = 31 * result + Arrays.hashCode(password);
        return result;
    }

}

        if (this == o) {
            return true;
        }
        if (!(o instanceof RedisCredentials)) {
            return false;
        }

        RedisCredentials that = (RedisCredentials) o;

        if (username != null ? !username.equals(that.getUsername()) : that.getUsername() != null) {
            return false;
        }
        return Arrays.equals(password, that.getPassword());
    
<no_super_class>