// Set the current item count and then choose a random position
// between where the generator is currently at and where it ends
synchronized (gen) {
gen.setCurrentItemCount(itemCount);
long position = rng.number(gen.getCurrentPosition(), gen.getTotalUsers());
user_id = gen.seekToPosition(position);
} // SYNCH
if (user_id == null) continue;
// Make sure that we didn't select the same UserId as the one we were
// told to exclude.