### Question:
InverseJacobianEstimateInitializationFunction implements NewtonRootFinderMatrixInitializationFunction { @Override public DoubleMatrix getInitializedMatrix(Function<DoubleArray, DoubleMatrix> jacobianFunction, DoubleArray x) { ArgChecker.notNull(jacobianFunction, "jacobianFunction"); ArgChecker.notNull(x, "x"); DoubleMatrix estimate = jacobianFunction.apply(x); DecompositionResult decompositionResult = _decomposition.apply(estimate); return decompositionResult.solve(DoubleMatrix.identity(x.size())); } InverseJacobianEstimateInitializationFunction(Decomposition<?> decomposition); @Override DoubleMatrix getInitializedMatrix(Function<DoubleArray, DoubleMatrix> jacobianFunction, DoubleArray x);  }### Answer:
@Test public void testNullFunction() { assertThatIllegalArgumentException() .isThrownBy(() -> ESTIMATE.getInitializedMatrix(null, X)); }
@Test public void testNullVector() { assertThatIllegalArgumentException() .isThrownBy(() -> ESTIMATE.getInitializedMatrix(J, null)); }
@Test public void test() { DoubleMatrix m1 = ESTIMATE.getInitializedMatrix(J, X); DoubleMatrix m2 = J.apply(X); DoubleMatrix m3 = (DoubleMatrix) (ALGEBRA.multiply(m1, m2)); DoubleMatrix identity = DoubleMatrix.identity(2); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { assertThat(m3.get(i, j)).isCloseTo(identity.get(i, j), offset(1e-6)); } } }