#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, i;
  long long int t;
  cin >> t;
  while (t--) {
    cin >> n;
    long long int a[n], x = -1, y = -1;
    for (i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    for (i = 0; i < n; i++) {
      if (a[i] - 1 == x)
        x = a[i];
      else {
        if (a[i] - 1 == y) y = a[i];
      }
    }
    cout << x + y + 2 << "\n";
  }
  return 0;
}
