I'm trying to get the min value of an array of int with streams, I'm trying to do something like:
public static int smallestInt(int[] args) {
return Arrays.stream((Arrays.stream(args)
.boxed().toArray( Integer[]::new ))
.mapToInt(Integer::intValue).min().getAsInt;
}
My question is what's the best way to do it?
PS: There's a similar question but without sterams here Finding the max/min value in an array of primitives using Java