#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long rng(long long l, long long u) {
  double f = 1. / (RAND_MAX + 1);
  return l + rand() * f * (u - l + 1);
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long bpow(long long a, int n) {
  return n ? n & 1 ? bpow(a, n - 1) * a : bpow(a * a, n >> 1) : 1;
}
bool prime(int n) {
  if (!n || n == 1) return 0;
  for (int i = 2; i <= sqrt(n); ++i) {
    if (n % i == 0) return 0;
  }
  return 1;
}
void solve() {
  multiset<int> s;
  int n;
  cin >> n;
  for (int x, i = 0; i < n; ++i) {
    cin >> x;
    s.insert(x);
  }
  int k = 0, sum = 0;
  for (int i = 0; i <= 101; ++i) {
    if (s.count(i) == 0) {
      sum += 2 * i;
      cout << sum;
      return;
    }
    if (s.count(i) == 1) {
      sum += i;
      s.insert(i);
      break;
    }
  }
  for (int i = 0; i <= 101; ++i) {
    if (s.count(i) == 0) {
      sum += i;
      break;
    }
  }
  cout << sum;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    solve();
    cout << '\n';
  }
  return 0;
}
