public boolean equals(Object o)
    {
        if (o == null || !(o instanceof Siteswap))
            return false;
        Siteswap s = (Siteswap)o;

        if (!isValid() && !s.isValid())
            return true;
        if (!isValid() && s.isValid())
            return false;
        if (isValid() && !s.isValid())
            return false;

        int[] sequence = s.getSequence();

        return Arrays.equals(
                Utils.normalize(siteswap),
                Utils.normalize(sequence));
    }