title: Java Random Color String
body: <p>I have written this java method but sometimes the color String is only 5 characters long. Does anyone know why?</p>
  
  <pre><code>@Test
  public void getRandomColorTest() {
      for (int i = 0; i &lt; 20; i++) {
          final String s = getRandomColor();
          System.out.println("-&gt; " + s);
      }
  }
  
   public String getRandomColor() {
      final Random random = new Random();
      final String[] letters = "0123456789ABCDEF".split("");
      String color = "#";
      for (int i = 0; i &lt; 6; i++) {
          color += letters[Math.round(random.nextFloat() * 15)];
      }
      return color;
  }
  </code></pre>