#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n], x = 0;
    map<int, int> m;
    for (int i = 0; i < n; i++) cin >> arr[i], m[arr[i]]++;
    int i;
    for (i = 0; i <= 100; i++) {
      if (m[i] < 2) {
        x += i;
        break;
      }
    }
    for (int j = i; j <= 100; j++) {
      if (m[j] == 0) {
        x += j;
        break;
      }
    }
    cout << x << endl;
  }
}
