#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    vector<int> v;
    cin >> n;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      v.push_back(a);
    }
    int c = 0;
    sort(v.begin(), v.end());
    for (int i = 0; i < v.size() - 1; i++) {
      if (abs(v[i] - v[i + 1]) == 1) {
        c = 1;
      }
    }
    if (c == 1)
      cout << "2" << endl;
    else
      cout << "1" << endl;
  }
  return 0;
}
