title: how to add random Integers to ArrayList without duplication
body: <p>I have this empty Array List.
  I wanted to add 6 randomly generated integers (1 to 6) but I don't want it to be duplicated.
   Somehow I cannot manage to create loop for that.
  I keep getting duplicated values, and even the size of Array List keep changing.
  here is my code.
  Thanks in advance.</p>
  
  <pre><code>    ArrayList al = new ArrayList();
  
      int rnd = new Random().nextInt(6)+1;
  
      while(!(al.contains(rnd))){
  
                  for(int i=0; i&lt;=5; i++){
  
                      al.add(rnd);
                      rnd = new Random().nextInt(6)+1;
  
                  }
  
                  rnd = new Random().nextInt(6)+1;
  
      }
  
      System.out.print(al);
  </code></pre>