#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> t;
  for (long long i = 0; i < t; i++) {
    int n;
    cin >> n;
    int a[n];
    for (int j = 0; j < n; j++) {
      cin >> a[j];
    }
    int occur[102];
    for (int j = 0; j <= 101; j++) {
      occur[j] = 0;
    }
    for (int j = 0; j < n; j++) {
      occur[a[j]]++;
    }
    int ans = 0;
    int one = 0;
    for (int j = 0; j <= 101; j++) {
      if (occur[j] >= 2) {
      } else if (occur[j] == 1) {
        if (one == 1) {
          continue;
        }
        ans += j;
        one = 1;
      } else {
        if (one == 1) {
          ans += j;
        } else {
          ans += 2 * j;
        }
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
