#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<pll> vpll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef unordered_map<ll,ll> um;
typedef unordered_set<ll> us;
#define fastio ios::sync_with_stdio(false);cout<<fixed;cin.tie(nullptr);cout.tie(nullptr);cout<<setprecision(0);
#define input(s) getline(cin, s);while(!s.length())getline(cin, s);
#define sqr(x) ((ll)(x) * (x))
#define reset(a, b) memset(a, b, sizeof(a))
#define FOR(i,a,b,c) for(ll i=a;i<b;i+=c)
#define FORD(i,a,b,c) for(ll i=a;i>b;i-=c)
#define mp make_pair
#define pb push_back
#define all(v) v.begin(), v.end()
#define allr(arr, r) arr, arr + r
#define showv(v) for(auto it: (v))cout<<it<<" ";newl;
#define showvp(v) for(auto it: (v)){cout<<it.first<<" "<<it.second;newl;}
#define show2d(v) for(auto it: (v)) {for(auto j:it) cout<<j<<" ";newl;}
#define printv(v) for(auto it: (v)) {cout<<it;newl;}
#define kick(i) cout<<"Case #"<<i+1<<": ";
#define newl cout<<"\n"
#define N 100000
#define SIZE  10000000
#define START 1000000
#define DIFF  1000000
const ll MAXN=1e+2+7;
const ll MOD=1e+9+7, INF=0x7f7f7f7f7f7f7f7f;const ll INFi=0x7f7f7f7f;
double EPS = 1e-9;
double PI = acos(-1);
vll adj[MAXN];ll visit[MAXN]={};
ll dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1},dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};
 
//<<-----Declare Variables Here------->>//
ll n,t,temp,ans;
vll v;
set<ll> s;
//<<-----Define Functions Here----->>//
//<<-----Start of Main--------------->>//
int main()
{
    fastio;
    cin>>t;
    FOR(i,0,t,1)
    {
        cin>>n;
        ans=0;
        v.clear();
        FOR(j,0,2*n+2,1)
        {
            v.pb(0);
        }
        //cout<<v.size();newl;
        FOR(j,0,n,1)
        {
            cin>>temp;
            v[temp]++;
        }
        // FOR(j,1,2*n+1,1)
        // {
        //     cout<<v[j]<<" ";
        // }newl;
        FORD(j, 2*n, 0, 1)
        {
            if(v[j+1]==0 && v[j])
            {
                v[j]--;
                v[j+1]++;
            }
        }
        FOR(j,1,v.size(),1)
        {
            if(v[j])
            ans++;
        }
        // FOR(j,1,2*n+1,1)
        // {
        //     cout<<v[j]<<" ";
        // }
        // newl;
        cout<<ans;
        newl;
    }
}