#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n, arr[10000];
  cin >> q;
  while (q--) {
    int check = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + n);
    for (int i = 0; i < n - 1; i++) {
      if (arr[i + 1] - arr[i] == 1) {
        cout << 2 << endl;
        check = 1;
        break;
      }
    }
    if (check == 0) {
      cout << 1 << endl;
    }
  }
}
