### Question:
CommonsMathWrapper { public static UnivariateFunction wrapUnivariate(Function<Double, Double> f) { ArgChecker.notNull(f, "f"); return f::apply; } private  CommonsMathWrapper(); static UnivariateFunction wrapUnivariate(Function<Double, Double> f); static RealMatrix wrap(DoubleMatrix x); static RealMatrix wrapAsMatrix(DoubleArray x); static DoubleMatrix unwrap(RealMatrix x); static RealVector wrap(DoubleArray x); static DoubleArray unwrap(RealVector x);  }### Answer:
@Test public void testNull1DFunction() { assertThatIllegalArgumentException() .isThrownBy(() -> CommonsMathWrapper.wrapUnivariate((Function<Double, Double>) null)); }
@Test public void test1DFunction() { UnivariateFunction commons = CommonsMathWrapper.wrapUnivariate(OG_FUNCTION_1D); for (int i = 0; i < 100; i++) { assertThat(OG_FUNCTION_1D.apply((double) i)).isCloseTo(commons.value(i), offset(1e-15)); } }