After a lot of searching, I finally managed to write the following methods to box and unbox primitive arrays using lambda expressions (double specifically):
public static Double[] box(double unboxed[]) {
return Arrays.stream(unboxed).boxed().toArray(Double[]::new);
}
public static double[] unbox(Double boxed[]) {
return Stream.of(boxed).mapToDouble(Double::doubleValue).toArray();
}
But now I needed to do the same with double[][] and Double[][], but I still don't understand lambda expressions enough in order to come up with a solution, neither I found anything searching.
Actually, I ended up needing to wrap my primitive matrices in a class for other reasons, so I no longer need to do this, but I thought it would be useful to have an answer for future reference.