title: Mix multiple strings into all the possible combinations
body: <p>I have some strings.</p>
  
  <ol>
  <li><p><code>1</code></p></li>
  <li><p><code>2</code></p></li>
  <li><p><code>3</code></p></li>
  </ol>
  
  <p>How do I combine them into all their unique combinations?</p>
  
  <ol>
  <li><p><code>123</code></p></li>
  <li><p><code>132</code></p></li>
  <li><p><code>213</code></p></li>
  <li><p><code>231</code></p></li>
  <li><p><code>312</code></p></li>
  <li><p><code>321</code></p></li>
  </ol>
  
  <p>Here is the code I have, but I would like to work without the <code>Random</code> class because I understand that this is not the best way to do it.</p>
  
  <pre><code>import java.util.Random;
  
  public class Solution
  {
      public static void main(String[] args)
      {
          String[] names = new String[]{"string1", "string2", "string3"};
          for (int i = 0; i &lt; 9; i++) {
              Random rand = new Random();
              int rand1 = rand.nextInt(3);
              System.out.println(names[rand.nextInt(3)] +
                      names[rand1] +
                      names[rand.nextInt(3)]);
          }
      }
  }
  </code></pre>