#include <bits/stdc++.h>
using namespace std;
bool flag = 0, flag1 = 0, flag2 = 0, flag3 = 0, flag4 = 0, flag5 = 0;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, k, ans = 0;
    cin >> n;
    multiset<long long int> a;
    for (long long int i = 0; i < n; i++) {
      cin >> k;
      a.insert(k);
    }
    for (long long int i = 0; i < n + 1; i++) {
      if (a.count(i) == 0) {
        ans += i;
        break;
      } else
        a.erase(a.find(i));
    }
    for (long long int i = 0; i < n + 1; i++) {
      if (a.count(i) == 0) {
        ans += i;
        break;
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
