#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long a[102] = {}, an = 0;
  ;
  for (long long i = 0; i < n; i++) {
    long long k;
    cin >> k;
    a[k]++;
  }
  for (long long i = 0; i < 102; i++) {
    if (a[i] == 0) {
      an = i;
      break;
    }
  }
  if (true) {
    vector<long long> v1;
    long long m1 = -1, c1 = 0;
    for (long long i = 0; i < 102; i++) {
      if (a[i] == 0) {
        if ((long long)v1.size() > 0) {
          v1.push_back(i);
          break;
        }
        v1.push_back(i);
        v1.push_back(i);
        break;
      } else if (a[i] == 1 && (long long)v1.size() == 0) {
        v1.push_back(i);
      }
    }
    an = max(an, v1[0] + v1[1]);
  }
  cout << an << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t1 = 1;
  cin >> t1;
  cout << fixed << setprecision(7);
  while (t1--) {
    solve();
  }
}
