#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& cur : a) cin >> cur;
  sort(a.begin(), a.end());
  int mex1 = 0;
  for (auto& cur : a) {
    if (cur == mex1) {
      cur = -1;
      mex1++;
    }
  }
  int mex2 = 0;
  for (auto& cur : a) {
    if (cur == mex2) {
      cur = -1;
      mex2++;
    }
  }
  cout << mex1 + mex2 << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
