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

        Matrix4 other = (Matrix4) obj;
        for (int i = 0; i < 4; i++)
            for (int j = 0; j < 4; j++) {
                if (A[i][j] != other.A[i][j])
                    return false;
            }
        return true;
    }