#include <bits/stdc++.h>
using namespace std;
long long int modexp(long long int x, long long int n, long long int mod) {
  x %= mod;
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * x % mod;
    x = x * x % mod;
    n /= 2;
  }
  return res;
}
long long int modInverse(long long int n, long long int p) {
  return modexp(n, p - 2, p);
}
long long int nCr(long long int n, long long int r, long long int p) {
  if (r == 0) return 1;
  long long int fac[n + 1];
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    long long int i, j, k;
    map<long long int, long long int> m;
    for (i = 0; i <= n - 1; i++) {
      cin >> arr[i];
      m[arr[i]]++;
    }
    long long int ans = 0;
    bool ok = true;
    for (i = 0; i <= 101; i++) {
      if (m[i] == 0) {
        if (ok)
          cout << 2 * i << '\n';
        else
          cout << ans + i << '\n';
        break;
      } else if (m[i] == 1 && ok) {
        ok = false;
        ans += i;
      }
    }
  }
  return 0;
}
