//BISMILLAHHIR RAHMANIR RAHIM
#include<bits/stdc++.h>
using namespace std;
typedef long long int            ll;
typedef unsigned long long int   ull;
#define min3(a,b,c)              min(a,min(b,c))
#define F                        first
#define S                        second
#define pb                       push_back
#define mp                       make_pair
#define pi                       2*acos(0.0)
#define MOD                      998244353
int main()
{
        int t;
        cin>>t;
        while(t--){
                int n,cnt[10000]={0};
                map<int,int>mp,sp;
                cin>>n;
                int ara[n];
                for(int i=0; i<n; i++){
                        cin>>ara[i];
                        //cnt[ara[i]]++;
                        mp[ara[i]]++;
                        sp[ara[i]]++;
                }
                /*if(st.size()==n)cout<<n<<endl;
                else{
                        for(int i=1; i<=10000; i++){
                                if(cnt[i]>1){
                                        cnt[i+1]++;
                                }
                        }
                        int ans=0;
                        for(int i=0; i<=10000; i++)if(cnt[i]!=0)ans++;
                        cout<<ans-1<<endl;

                }*/
                if(mp.size()==n)cout<<n<<endl;
                else{
                        for(auto a:mp){
                                if(a.S>1){
                                        sp[a.F+1]++;
                                        mp[a.F+1]++;
                                        //cout<<sp[a.F]<<endl;
                                        //cout<<a.F+1<<endl;//" "<<a.S<<endl;
                                }
                        }
                       cout<<sp.size()<<endl;
                }


        }
}
