#include <bits/stdc++.h>
using namespace std;
long long a[101];
long long vis[101];
long long judge(vector<long long> A) {
  if (A.empty()) return 0;
  for (long long i = 0; i < A.size(); i++) {
    if (A[i] != i) return i;
  }
  return A.size();
}
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    for (long long i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + n + 1);
    memset(vis, 0, sizeof vis);
    vector<long long> A, B;
    vis[1] = 1;
    A.push_back(a[1]);
    for (long long i = 2; i <= n; i++) {
      if (a[i] != a[i - 1]) {
        vis[i] = 1;
        A.push_back(a[i]);
      }
    }
    for (long long i = 1; i <= n; i++) {
      if (!vis[i]) {
        B.push_back(a[i]);
      }
    }
    B.erase(unique(B.begin(), B.end()), B.end());
    cout << judge(A) + judge(B) << endl;
  }
  return 0;
}
