#include <iostream>
#include <set>

using namespace std;

int main(){
  int t;
  cin >> t;

  while(t--){
    int n, a;
    cin >> n;
    set<int> arr;

    for(int i = 0; i < n; ++i){
      cin >> a;
      int currentSize = arr.size();
      arr.insert(a);
      
      if(arr.size() == currentSize)
        arr.insert(a+1);
    }

    cout << arr.size() << "\n";
  }

  return 0;
}