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