It is not a stretch to envision someone writing:
public interface DoubleFunction extends Function<Double, Double> {}
And while it is good practice to declare the functional method Double apply(Double in);, I don't know that we should require it.
At the very least, we should ensure that the matcher throws an informative, suitable error when asked for a DoubleFunction. Currently, an IndexOutOfBoundsException is thrown here. At the very least, we should throw some IllegalArgumentException. It would be even cooler if we could just find the functional interface within Function.
It is not a stretch to envision someone writing:
And while it is good practice to declare the functional method
Double apply(Double in);, I don't know that we should require it.At the very least, we should ensure that the matcher throws an informative, suitable error when asked for a
DoubleFunction. Currently, anIndexOutOfBoundsExceptionis thrown here. At the very least, we should throw someIllegalArgumentException. It would be even cooler if we could just find the functional interface withinFunction.