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