#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    if (n == 1) {
      cout << "1" << endl;
      cin >> n;
      continue;
    }
    int arr[n];
    for (int i = 0; i < n; i++) cin >> arr[i];
    int sii = sizeof(arr) / sizeof(arr[0]);
    sort(arr, arr + sii);
    bool pp = true;
    int i = 1;
    while (i < n) {
      if ((arr[i] - arr[i - 1]) == 1) {
        pp = false;
        break;
      }
      i++;
    }
    if (pp == false)
      cout << "2" << endl;
    else
      cout << "1" << endl;
  }
}
