#include <bits/stdc++.h>
const int N = 1e5 + 10;
using namespace std;
int main() {
  int t;
  int dp[111];
  cin >> t;
  while (t--) {
    memset(dp, 0, sizeof(dp));
    int n;
    cin >> n;
    int i;
    for (i = 0; i < n; i++) {
      int k;
      cin >> k;
      dp[k]++;
    }
    int ans = -1;
    int book = -1;
    for (i = 0; i < 101; i++) {
      if (dp[i] <= 1 && ans == -1) {
        ans = i;
      }
      if (dp[i] == 0 && book == -1) {
        book = i;
      }
      if (book != -1 && ans != -1) break;
    }
    cout << ans + book << endl;
  }
  return 0;
}
