public boolean equals(Object obj)
    {
       //standard equals() 
       if(((Piece) obj).body.length != this.body.length)
           return false;
       
       Collection setA = new HashSet();
       Collection setB = new HashSet();
       
       for (int i = 0; i < this.body.length; i++)
       {
           setA.add(((Piece) obj).body[i]);
           setB.add(this.body[i]);
         
       }
           boolean res = setA.equals(setB);
           return setA.equals(setB);
       
    }