title: How big is the chance to get a Java UUID.randomUUID collision?
body: <p>I need to create some uniques files in Java and i plan to use UUID.randomUUID to generate their names. Is there any chance to get a collision for this? Should i do something like bellow os I shouldn't worry about this?</p>
  
  <pre><code>Integer attemptsToGenerateUUID = 1;
  
  while (true) {
      UUID fileUUID = UUID.randomUUID();
  
      if (fileDoesNotExistwith this UUID name) {
          save file;
          break;
      }
  
      attemptsToGenerateUUID += 1;
  
      if (attemptsToGenerateUUID &gt; 64) {
          return false;
      }
  }
  </code></pre>