#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      v.push_back(x);
    }
    sort(v.begin(), v.end());
    int l = 0, r = 0;
    for (int i = 0; i < n; i++) {
      if (v[i] == l)
        l++;
      else if (v[i] == r)
        r++;
    }
    cout << l + r << endl;
  }
  return 0;
}
