title: Java: do something x percent of the time
body: <p>I need a few lines of Java code that run a command x percent of the time at random.</p>
  
  <p>psuedocode:</p>
  
  <pre><code>boolean x = true 10% of cases.
  
  if(x){
    System.out.println("you got lucky");
  }
  </code></pre>