title: How do I generate random numbers from an array without repetition?
body: <p>I know similar question have been asked before but bear with me.</p>
  
  <p>I have an array:</p>
  
  <pre><code>int [] arr = {1,2,3,4,5,6,7,8,9};
  </code></pre>
  
  <p>I want numbers to be generated randomly 10 times. Something like this:</p>
  
  <pre><code>4,6,8,2,4,9,3,8,7
  </code></pre>
  
  <p>Although some numbers are repeated, no number is generated more than once in a row. So not like this:</p>
  
  <pre><code>7,3,1,8,8,2,4,9,5,6
  </code></pre>
  
  <p>As you can see, the number 8 was repeated immediately after it was generated. This is not the desired effect.</p>
  
  <p>So basically, I'm ok with a number being repeated as long as it doesn't appear more than once in a row.</p>