#include <bits/stdc++.h>
using namespace std;
long double PI = 3.14159265358979323846;
const long long M = 1e9 + 7;
const long long inf = 1e18;
const long long ms = 2e5 + 5;
static int fastline = []() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  return 0;
}();
;
unsigned long long ans;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v1, v2;
  map<long long, long long> mp;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  for (auto &it : mp) {
    if (it.second) {
      v1.push_back(it.first);
      it.second--;
    }
    if (it.second) {
      v2.push_back(it.first);
      it.second--;
    }
  }
  long long a1 = v1.size(), a2 = v2.size();
  for (int i = 0; i < v1.size(); i++) {
    if (i != v1[i]) {
      a1 = i;
      break;
    }
  }
  for (int i = 0; i < v2.size(); i++) {
    if (i != v2[i]) {
      a2 = i;
      break;
    }
  }
  cout << a1 + a2 << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
