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

        State state = (State) o;

        if (firstEverMove != state.firstEverMove) return false;
        if (firstMoveOfSequence != state.firstMoveOfSequence) return false;
        if (!Arrays.equals(heights, state.heights)) return false;
        if (!Arrays.equals(owners, state.owners)) return false;
        if (playerToMove != state.playerToMove) return false;
        if (!Arrays.equals(stoneTypes, state.stoneTypes)) return false;

        return true;
    }