title: Create java collection with n clones of an object
body: <p>In Java, is there a one-line way to create a collection that is initialized with <em>n</em> clones of an object?</p>
  
  <p>I'd like the equivalent of this:</p>
  
  <ul>
  <li><code>foo = vector&lt;vector&lt;int&gt; &gt;(10);</code> c++, creates 10 different empty vectors</li>
  <li><code>[ [] for i in range(10) ]</code> Python, an array of 10 distinct empty arrays</li>
  <li><code>Array.new(10) { [] }</code> Ruby, same as Python</li>
  </ul>
  
  <p>In Java, I've only found</p>
  
  <pre><code>new ArrayList&lt;ArrayList&lt;Integer&gt; &gt;(Collections.nCopies(10, new ArrayList&lt;Integer&gt;()))
  </code></pre>
  
  <p>However, this is <em>not</em> equivalent to the other examples, because the lists alias.</p>
  
  <p>Is there a way to create an array of distinct object clones, without using a for loop, and preferably without resorting to <a href="https://stackoverflow.com/questions/3907394/java-is-there-a-map-function">external libraries</a>?</p>