#include<bits/stdc++.h>
using namespace std;
/*-------------------------------------------------------------------- standard declarations ------------------------------------------------------------------ */
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll, ll> pp;
typedef vector<pair<ll, ll> > vllp;
#define fr(i,a,b) for(ll i=a;i<b;i++)
#define frr(i,a,b) for(ll i=a;i>=b;i--)
#define forn(i, n) for (ll i = 0; i < ll(n); i++)
#define err() cout<<"=================================="<<endl;
#define errA(A) for(auto i:A)   cout<<i<<" ";cout<<endl;
#define all(A)  A.begin(),A.end()
#define allr(A)    A.rbegin(),A.rend()
#define ft first
#define sd second
#define pb push_back
/*---------------------------------------------------------------------- comparators -------------------------------------------------------------------------- */
struct cmp {
	bool operator() (const pair<ll, ll> &a, const pair<ll, ll> &b) const {
		if (a.ft != b.ft) {
			return a.ft < b.ft;
		} else {
			return a.sd > b.sd;
		}
	}
};
/*--------------------------------------------------------------------- standard global variables -----------------------------------------------------------------------*/
#define PI 3.14159265
#define mod 1000000007
ll TESTTEST;
ll dir[4][2] = {{1, 0}, {0, 1}, { -1, 0}, {0, -1}};
const ll mxn = 200001;
/*---------------------------------------------------------------------- templates -------------------------------------------------------------------------- */

/*--------------------------------------------------------------------- global variables -----------------------------------------------------------------------*/

/*--------------------------------------------------------------------- global functions -----------------------------------------------------------------------*/

/*--------------------------------------------------------------------- main function --------------------------------------------------------------------------*/
void solve() {
	ll n;
	cin >> n;
	vll a(n);
	fr(i, 0, n)cin >> a[i];
	map<ll, ll> mp;
	fr(i, 0, n ) {
		if (mp[a[i]] == 0) {
			mp[a[i]]++;
		} else {
			mp[a[i] + 1]++; ;
		}
	}
	cout << mp.size()  << "\n";
	return;
}


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ll zzz = 1;
	cin >> zzz;
	for (TESTTEST = 1; TESTTEST < (zzz + 1); TESTTEST++) {
		solve();
	}
	return 0;
}