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