#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int p = -1, q = -1, a, d = 0;
    vector<int> h(101, 0);
    for (int i = 0; i < n; i++) {
      cin >> a;
      h[a]++;
    }
    for (int i = 0; i <= n; i++) {
      if (h[i] == 0) {
        cout << p + q + 2 << endl;
        break;
      } else if (h[i] == 1) {
        p++;
        d = 1;
      } else {
        p++;
        if (d == 0) q++;
      }
    }
  }
}
