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