#include <bits/stdc++.h>

#define ll long long

using namespace std;

int main()
{
ios_base::sync_with_stdio(false);
	
cin.tie(NULL); 
ll t;
cin>>t;
while(t--)
{

ll n;
cin>>n;
set<ll> s;
ll arr[n];
for( ll i=0;i<n;i++){
	cin>>arr[i];
	if(s.count(arr[i])==1)
	s.insert(arr[i]+1);
	s.insert(arr[i]);
	
}
cout<<s.size()<<" ";
		 
 
}
}