#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int t, n, a, dem[105], mexb, mexa;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    memset(dem, 0, sizeof(dem));
    for (int i = 1; i <= n; ++i) {
      cin >> a;
      ++dem[a];
    }
    mexb = -1;
    mexa = -1;
    for (int i = 0; i <= 101; ++i) {
      if (dem[i] == 0) {
        mexa = i;
        if (mexb == -1) mexb = i;
        break;
      } else if (dem[i] == 1 && mexb == -1)
        mexb = i;
    }
    if (mexa == -1) mexa = 0;
    if (mexb == -1) mexb = 0;
    cout << mexa + mexb << endl;
  }
  return 0;
}
