#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  long long int count[1000] = {0};
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    count[arr[i]]++;
  }
  long long int a, b;
  for (int i = 0; i < 1000; i++) {
    if (count[i] == 0) {
      a = i;
      break;
    }
    if (count[i] > 0) count[i]--;
  }
  for (int i = 0; i < 1000; i++) {
    if (count[i] == 0) {
      b = i;
      break;
    }
    if (count[i] > 0) count[i]--;
  }
  cout << a + b << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  for (int i = 0; i < t; i++) solve();
  return 0;
}
