title: Writing a JUnit test for a random number generator
body: <p>I have a method which returns a random number between 0 and 10.</p>
  
  <pre><code>public int roll(){
      int pinsKnockedDown = (int) (Math.random() * 10);
      return pinsKnockedDown;
  }
  </code></pre>
  
  <p>How would I write a JUnit test for this? So far I have put the call in a loop so it runs 1000 times and fails the test if
  - the number is less than 0
  - the number is more than 10</p>
  
  <p>How can I test that all the numbers aren't just the same, i.e.</p>
  
  <p><img src="https://i.stack.imgur.com/VjJgg.jpg" alt="Dilbert"></p>