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