title: Converting Scala array of Int to Java array of Integer
body: <p>How to convert Scala <code>Array[Int]</code> to Java <code>Integer[]</code>? It seems that the default is to convert int to <code>int[]</code> and that's not a proper argument for method defined as </p>
  
  <pre><code>public static &lt;T extends Comparable&lt;? super T&gt;&gt; T[] merge(T[] xs)
  </code></pre>
  
  <p>Compiling fails with the following error</p>
  
  <pre><code>type mismatch;
   found   : Array[Int]
   required: Array[? with Object]
  Note: Int &gt;: ? with Object, but class Array is invariant in type T.
  You may wish to investigate a wildcard type such as `_ &gt;: ? with Object`. (SLS 3.2.10)
        val res = SimpleSort.merge(xs)
  
                               ^
  </code></pre>