#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, i;
  cin >> t;
  while (t--) {
    cin >> n;
    int arr[n];
    for (i = 0; i < n; i++) cin >> arr[i];
    sort(arr, arr + n);
    int A = 0;
    int B = 0;
    for (int i = 0; i < n; i++) {
      if (arr[i] == A) {
        A++;
      } else if (B == arr[i]) {
        B++;
      }
    }
    cout << A + B << endl;
  }
  return 0;
}
