#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9+7;
#define el "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi 3.14159265358
#define F first
#define S second
#define pb push_back 
#define mp make_pair
#define f(i,x,y) for(i=x;i<y;i++) 
#define fo(i,x,y) for(i=x;i>=y;i--)
#define all(v) v.begin(),v.end()
#define ss(v) sort(all(v))
//cout<<setprecision(9);
// sieve
/*bool prime[100000];
void sieve(ll n) 
{ 
    
    memset(prime, true, sizeof(prime)); 
    for (ll p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            for (ll i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
    

}
*/
void solve(){
 ll n;
 cin>>n;
 ll a[n],i;
 set<ll>s;
 f(i,0,n){cin>>a[i];
 if(!s.count(a[i]))
 s.insert(a[i]);
 else if(!s.count(a[i]+1))
 s.insert(a[i]+1);
 }
 
 
 cout<<s.size()<<el;
 
}

int main() {
fastio
ll _;
_=1;
cin>>_;
while(_--)
{
solve();

}
return 0;
}

