title: Java: random long number in 0 <= x < n range
body: <p>Random class has a method to generate random int in a given range. For example:</p>
  
  <pre><code>Random r = new Random(); 
  int x = r.nextInt(100);
  </code></pre>
  
  <p>This would generate an int number more or equal to 0 and less than 100. I'd like to do exactly the same with long number.</p>
  
  <pre><code>long y = magicRandomLongGenerator(100);
  </code></pre>
  
  <p>Random class has only nextLong(), but it doesn't allow to set range.</p>