IntelliJ has been telling me that the Double[] is an error: bad return type in method reference: cannot convert Double[] to A[]. I have used double[], removed the ::new static reference, and still the same error. How do I resolve this error? I am attempting to get back 1.000 in the filtered results.
double[] pricesDoubleArr = {1.000,2.800,4.900};
double[] pricesDoubleFiltered = Arrays.stream(pricesDoubleArr)
.filter(x -> x != Math.round(x))
.toArray(Double[]::new);