public boolean equals(Tableau other) {
        if (this.rank != other.rank) return false;
        for (int i = 1; i <= rank; i++) {
            if (inTableau(i) && !other.inTableau(i)) return false;
            if (!inTableau(i) && other.inTableau(i)) return false;
            if (inTableau(i) && other.inTableau(i)) {
                if (!getDomino(i).equals(other.getDomino(i))) return false;
            }
        }
        return true;
    }