Oh good catch, Java.Double is imported as Double in this file so Array[Double] is actually Array[java.lang.Double]. Instead I switched the return type to Array[scala.lang.Double] since the collections API says that mirrors double[] and lets us remove the explicit boxing.