### Question:
RealPolynomialFunction1D implements DoubleFunction1D { @Override public RealPolynomialFunction1D derivative() { int n = _coefficients.length - 1; double[] coefficients = new double[n]; for (int i = 1; i <= n; i++) { coefficients[i - 1] = i * _coefficients[i]; } return new RealPolynomialFunction1D(coefficients); } RealPolynomialFunction1D(double... coefficients); @Override double applyAsDouble(double x); double[] getCoefficients(); @Override DoubleFunction1D add(DoubleFunction1D f); @Override RealPolynomialFunction1D add(double a); @Override RealPolynomialFunction1D derivative(); @Override RealPolynomialFunction1D divide(double a); @Override DoubleFunction1D multiply(DoubleFunction1D f); @Override RealPolynomialFunction1D multiply(double a); @Override DoubleFunction1D subtract(DoubleFunction1D f); @Override RealPolynomialFunction1D subtract(double a); RealPolynomialFunction1D toMonic(); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testDerivative() { final double x = RANDOM.nextDouble(); assertThat(3 * C[3] * Math.pow(x, 2) + 2 * C[2] * x + C[1]).isCloseTo(F.derivative().applyAsDouble(x), offset(EPS)); }