#include <bits/stdc++.h>
using namespace std;
bool f(int arr[], int n) {
  for (int i = 0; i < n; i++)
    if (arr[i] == 0) return false;
  return true;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[101];
    memset(arr, 0, sizeof(arr));
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      arr[x]++;
    }
    int a = 0, b = 0;
    for (int i = 0; i < 101; i++) {
      if (arr[i] != 0)
        arr[i]--;
      else {
        a += i;
        break;
      }
    }
    for (int i = 0; i < 101; i++) {
      if (arr[i] != 0)
        arr[i]--;
      else {
        b += i;
        break;
      }
    }
    cout << a + b << endl;
  }
  return 0;
}
