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