#include <bits/stdc++.h>
using namespace std;
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> cnt(102, 0);
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    cnt[x]++;
  }
  long long sum = 0;
  for (int i = 0; i <= 100; i++) {
    if (cnt[i] == 0) {
      sum += i;
      break;
    }
  }
  for (int i = 0; i <= 100; i++) {
    if (cnt[i] <= 1) {
      sum += i;
      break;
    }
  }
  cout << sum << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  cin >> test;
  while (test--) solve();
  return 0;
}
