#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v;
    long long i;
    for (i = 0; i < n; i++) {
      long long f;
      cin >> f;
      v.push_back(f);
    }
    vector<long long> mark(102, 0);
    for (i = 0; i <= 101; i++) {
      mark[i] = 0;
    }
    for (i = 0; i < n; i++) {
      mark[v[i]]++;
    }
    long long req = 2;
    long long ans = 0;
    for (i = 0; i <= 101; i++) {
      if (mark[i] < 2) {
        long long offer = 2 - mark[i];
        long long f = min(req, offer);
        ans += (i * f);
        req = req - f;
      }
      if (req == 0 || req == 1) break;
    }
    if (req == 0) {
      cout << ans << endl;
    } else {
      i++;
      for (; i <= 101; i++) {
        if (mark[i] == 0) {
          ans += i;
          break;
        }
      }
      cout << ans << endl;
    }
  }
}
