### Question:
InitialStateCalculator { protected RealMatrix calculateSubtrahendForZIN() { int matrixSize = numberOfCoefficients - 1; double[][] subtrahendData = new double[matrixSize][matrixSize]; for (int i = 0; i < matrixSize; i++) { subtrahendData[i][0] = -1 * aCoefficients[i+1]; } for (int row = 0; row < matrixSize-1; row++) subtrahendData[row][row+1] = 1; return new Array2DRowRealMatrix(subtrahendData); } InitialStateCalculator(FilterCoefficients filterCoefficients); double[] getInitialState(); double[] growSignal(double[] signal); double[] growSignal(double[] signal, boolean leftOnly);  }### Answer:
@Test public void testCalculateSubtrahendForZIN() { InitialStateCalculator calculator = new InitialStateCalculator(getSampleFilterCoefficients1()); RealMatrix actual = calculator.calculateSubtrahendForZIN(); RealMatrix expected = new Array2DRowRealMatrix(new double[][] { {2.6861574, 1, 0}, {-2.41965511, 0, 1}, {0.73016535, 0, 0} }); assertMatrixEquals(expected, actual, 1e-7); calculator = new InitialStateCalculator(getSampleFilterCoefficients2()); actual = calculator.calculateSubtrahendForZIN(); expected = new Array2DRowRealMatrix(new double[][] { {-0.11, 1, 0, 0, 0}, {0.5, 0, 1, 0, 0}, {-0, 0, 0, 1, 0}, {-0, 0, 0, 0, 1}, {-0, 0, 0, 0, 0} }); assertMatrixEquals(expected, actual, 1e-7); }