#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  cin >> q;
  for (int ab = 0; ab < (q); ++ab) {
    int n;
    cin >> n;
    vector<int> arr(n);
    bool good = true;
    for (int i = 0; i < (n); ++i) {
      cin >> arr[i];
    }
    sort(arr.begin(), arr.end());
    for (int i = (1); i < ((int)arr.size()); i++) {
      if (arr[i] == arr[i - 1] + 1) {
        good = false;
        break;
      }
    }
    if (good)
      cout << 1 << endl;
    else
      cout << 2 << endl;
  }
  return 0;
}
