class HgTriple<X, Y, Z> {

    private final X x;
    private final Y y;
    private final Z z;
    private int hash = -1;

    public HgTriple(X x, Y y, Z z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    public X getX() {
        return x;
    }

    public Y getY() {
        return y;
    }

    public Z getZ() {
        return z;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        HgTriple<?, ?, ?> hgTriple = (HgTriple<?, ?, ?>) o;
        return Objects.equals(x, hgTriple.x) && Objects.equals(y, hgTriple.y) &&
               Objects.equals(z, hgTriple.z);
    }

    @Override
    public int hashCode() {<FILL_FUNCTION_BODY>}

    @Override
    public String toString() {
        return "HgTriple{" +
               "x=" + x +
               ", y=" + y +
               ", z=" + z +
               '}';
    }
}

        if (hash == -1) {
            hash = Objects.hash(x, y, z);
        }
        return this.hash;
    
<no_super_class>