Filling array with integer values
<p>I have the following code:</p>

<pre><code>public static &lt;T extends Comparable&lt;T&gt;&gt; T[] getRandomPermutationOfIntegers(int size) {
      T[] data = (T[])new Comparable[size]; 
      for (int i = 0; i &lt; size; i++) {
          data[i] = i;
      }
      // shuffle the array
      for (int i = 0; i &lt; size; i++) {
          int temp;
          int swap = i + (int) ((size - i) * Math.random());
          temp = data[i];
          data[i] = data[swap];
          data[swap] = temp;
      }
      return data;
  }
</code></pre>

<p>which permutes an array of integers and return them. I want to fill the array with int values but am getting error in the two for() loops since T is different from int.</p>

<p>How do i fix them to make them work?</p>
