#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  for (int u = 0; u < t; u++) {
    long long int n;
    cin >> n;
    vector<long long int> A;
    for (long long int i = 0; i < n; i++) {
      long long int x;
      cin >> x;
      A.push_back(x);
    };
    sort(A.begin(), A.end());
    long long int longestseq = 1;
    long long int seq = 1;
    for (int i = 1; i < n; i += 1) {
      if (A[i] - A[i - 1] == 1) {
        seq++;
        longestseq = max(longestseq, seq);
      } else
        seq = 1;
    }
    if (longestseq > 1)
      cout << "2\n";
    else
      cout << "1\n";
  }
  return 0;
}
