#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int q, n, i, u, a, mc, cc;
int main() {
  cin >> q;
  for (u = 1; u <= q; u++) {
    cin >> n;
    v.clear();
    for (i = 1; i <= n; i++) {
      cin >> a;
      v.push_back(a);
    }
    sort(v.begin(), v.end());
    if (n == 1) {
      cout << 1 << '\n';
    } else {
      cc = 1;
      mc = 1;
      for (i = 1; i < n; i++) {
        if (v[i] == v[i - 1] + 1) {
          mc = 2;
        }
      }
      cout << mc << '\n';
    }
  }
  return 0;
}
