### Question:
JacobiPolynomialFunction extends OrthogonalPolynomialFunctionGenerator { @Override public DoubleFunction1D[] getPolynomials(int n) { throw new UnsupportedOperationException("Need values for alpha and beta for Jacobi polynomial function generation"); }  @Override DoubleFunction1D[] getPolynomials(int n); @Override Pair<DoubleFunction1D, DoubleFunction1D>[] getPolynomialsAndFirstDerivative(int n); DoubleFunction1D[] getPolynomials(int n, double alpha, double beta); Pair<DoubleFunction1D, DoubleFunction1D>[] getPolynomialsAndFirstDerivative(int n, double alpha, double beta);  }### Answer:
@Test public void testNoAlphaBeta() { assertThatExceptionOfType(UnsupportedOperationException.class) .isThrownBy(() -> JACOBI.getPolynomials(3)); }
@Test public void testNegativeN() { assertThatIllegalArgumentException() .isThrownBy(() -> JACOBI.getPolynomials(-3, ALPHA, BETA)); }
@Test public void testGetPolynomials() { assertThatExceptionOfType(UnsupportedOperationException.class) .isThrownBy(() -> JACOBI.getPolynomialsAndFirstDerivative(3)); }
@Test public void test() { DoubleFunction1D[] p = JACOBI.getPolynomials(0, ALPHA, BETA); assertThat(p.length).isEqualTo(1); final double x = 1.23; assertThat(p[0].applyAsDouble(x)).isCloseTo(1, offset(EPS)); for (int i = 0; i <= 2; i++) { p = JACOBI.getPolynomials(i, ALPHA, BETA); for (int j = 0; j <= i; j++) { assertThat(P[j].applyAsDouble(x)).isCloseTo(p[j].applyAsDouble(x), offset(EPS)); } } }