#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  map<int, int> m;
  int i, j, k, l, a, b, n, t, c;
  cin >> t;
  for (int x = 1; x <= t; x++) {
    cin >> a;
    c = 0;
    v.clear();
    for (i = 1; i <= a; i++) {
      cin >> b;
      v.push_back(b);
    }
    sort(v.begin(), v.end());
    for (i = 0; i + 1 < v.size(); i++) {
      if (v[i + 1] - v[i] == 1) {
        c = 1;
        break;
      }
    }
    if (c == 0)
      cout << "1\n";
    else
      cout << "2\n";
  }
}
