Create two random number generators with the same seed
import java.util.Random;
publicclass Main {
publicstaticvoid main(String[] argv) throws Exception {
Random rand = new Random();
long seed = rand.nextLong();
rand = new Random(seed);
Random rand2 = new Random(seed);
}
}