#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795L
#ifdef ONLINE_JUDGE
#define debug(args...) (0)
#else
#include "debug.h"
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll n,x[100000];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
#ifndef ONLINE_JUDGE
  freopen("inp.txt", "r", stdin);
#endif
  int T;
  cin>>T;
  while (T--) {
    cin>>n;
    for (int i=0;i<n;i++)cin>>x[i];
    x[n-1]++;
    for (int i=n-2;i>=0;i--) {
      if (x[i+1]>x[i]+1) {
        x[i]++;
      }
    }
    sort(x,x+n);
    int uq=1;
    for (int i=1;i<n;i++) {
      if (x[i]!=x[i-1])uq++;
    }
    cout<<uq<<'\n';
  }
}
