title: How to generate the same random sequence twice in java?
body: <pre><code>public class MazeBuilder implements Runnable {
  
      // class internal local variables
      protected SingleRandom random ; // random number stream, used to make randomized decisions, e.g for direction to go
      Order order; // describes what is wanted, e.g. a perfect maze or not    
      /**
       * Constructor for a randomized maze generation
       */
      public MazeBuilder(){
          random = SingleRandom.getRandom();
      }
      /**
       * Constructor with option to make maze generation deterministic or random
       */
      public MazeBuilder(boolean deterministic){
          if (true == deterministic)
          {
              this.random = random ;
          }
  
  
      random = SingleRandom.getRandom();
  }
  </code></pre>
  
  <p>The first constructor randomly generates a maze. I need to implement code so that if MazeBuilder.build is called for the same skill level twice, it will deliver the same results. I think "this.random = random ;" in the second constructor will do this, but I'm not sure this is correct.</p>