#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
constexpr ll mod = 1e9 + 7;
inline void solve() {
  int n;
  cin >> n;
  vector<int> vec(n), ans;
  for (auto& x : vec) cin >> x;
  bool check[n];
  memset(check, 0, sizeof(check));
  for (int i = 0; i < 2 * n; ++i) {
    bool used[n + 1];
    memset(used, 0, sizeof(used));
    for (int j = 0; j < n; ++j) used[vec[j]] = 1;
    int mn = n;
    for (int j = 0; j <= n; ++j)
      if (!used[j]) {
        mn = j;
        break;
      }
    if (mn == n) {
      for (int j = 0; j < n; ++j)
        if (!check[j]) {
          vec[j] = n, ans.emplace_back(j);
          break;
        }
      continue;
    }
    vec[mn] = mn;
    ans.emplace_back(mn);
    check[mn] = 1;
  }
  cout << ans.size() << '\n';
  for (auto& x : ans) cout << x + 1 << ' ';
  cout << '\n';
}
int main() {
  cin.tie(nullptr), cout.tie(nullptr), ios::sync_with_stdio(false);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
}
