#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y, ind;
  char ch;
};
long long mod = 1e9 + 7;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long fact[13];
void factorial() {
  fact[0] = 1;
  for (long long i = 1; i < 12; i++) fact[i] = (fact[i - 1] * i);
}
bool cmp(point A, point B) {
  if (A.x != B.x) return A.x < B.x;
  return A.y < B.y;
}
vector<long long> sie;
long long spf[1000007 + 7];
void sieve() {
  for (long long i = 2; i < 1000007; i++) {
    if (spf[i] == 0) {
      spf[i] = i;
      sie.push_back(i);
    }
    for (long long j = 0; j < ((long long)(sie).size()) &&
                          i * sie[j] <= 1000007 && sie[j] <= spf[i];
         j++)
      spf[i * sie[j]] = sie[j];
  }
}
const long long mx = 2e5 + 9;
long long n, a, b, _, ans, c, _1, _2, m, an, k, need, shuru, _3, _c, _a, _b,
    way, _0, mex, q, d, temp;
double DF, AF;
string st, good, orginal[2];
long long ar[mx], co[mx];
long long sol(long long x, long long y) { return _1; }
void f() {
  for (long long i = 0; i < 103; i++) co[i] = 0;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> _;
    co[_]++;
  }
  ans = 0;
  _ = 0;
  for (long long i = 0; i < 102; i++) {
    if (co[i] >= 2) continue;
    if (co[i] && _ == 0) {
      _ = 1;
      ans = i;
    } else if (co[i] == 0 && _ == 1) {
      _ = 2;
      ans += i;
    } else if (co[i] == 0 && _ == 0) {
      _ = 2;
      ans = i + i;
    }
    if (_ == 2) break;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(12);
  long long _t;
  cin >> _t;
  for (long long w = 0; w < _t; w++) f();
  return 0;
}
