public boolean equals(Object o) {
	if ( this == o ) {
	    return true;
	} else if ( !(o instanceof Move) ) {
	    return false;
	} else {
	    Move mo = (Move) o;

	    // Check that each Atomic Move is the same.
	    // Make copies so as not to modify state.
	    Move this_copy = (Move) this.clone();
	    Move mo_copy = (Move) mo.clone();

	    this_copy.sort();
	    mo_copy.sort();
	    if (this_copy.moves.size() != mo_copy.moves.size()) {
		return false;
	    } else {
		for (int i=0; i<this_copy.moves.size(); i++) {
		    if (!((AtomicMove) this_copy.moves.elementAt(i)).equals(mo_copy.moves.elementAt(i))) {
			return false;
		    }
		}
	    }
	    return true;
	}
    }