#include <bits/stdc++.h>
using namespace std;
int main() {
  int queries;
  cin >> queries;
  vector<int> teamCounts;
  for (int j = 0; j < queries; j++) {
    int noStu;
    cin >> noStu;
    vector<int> skills;
    for (int i = 0; i < noStu; i++) {
      int s;
      cin >> s;
      skills.push_back(s);
    }
    sort(skills.begin(), skills.end());
    int teamCount = 1;
    for (int i = 1; i < noStu; i++) {
      if (skills[i] - skills[i - 1] == 1) {
        teamCount++;
        break;
      }
    }
    teamCounts.push_back(teamCount);
  }
  for (int i = 0; i < queries; i++) {
    cout << teamCounts[i] << endl;
  }
}
