### Question:
GaussianQuadratureIntegrator1D extends Integrator1D<Double, Double> { @Override public Double integrate(Function<Double, Double> function, Double lower, Double upper) { ArgChecker.notNull(function, "function"); ArgChecker.notNull(lower, "lower"); ArgChecker.notNull(upper, "upper"); Function<Double, Double> integral = getIntegralFunction(function, lower, upper); return integrateFromPolyFunc(integral); } GaussianQuadratureIntegrator1D(int n, QuadratureWeightAndAbscissaFunction generator); @Override Double integrate(Function<Double, Double> function, Double lower, Double upper); double integrateFromPolyFunc(Function<Double, Double> polyFunction); abstract Double[] getLimits(); abstract Function<Double, Double> getIntegralFunction(
      Function<Double, Double> function,
      Double lower,
      Double upper); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testGaussLegendre() { double upper = 2; double lower = -6; final Integrator1D<Double, Double> integrator = new GaussLegendreQuadratureIntegrator1D(6); assertThat(F1.apply(upper) - F1.apply(lower)).isCloseTo(integrator.integrate(DF1, lower, upper), offset(EPS)); lower = -0.56; upper = 1.4; assertThat(F1.apply(upper) - F1.apply(lower)).isCloseTo(integrator.integrate(DF1, lower, upper), offset(EPS)); }
@Test public void testGaussLaguerre() { final double upper = Double.POSITIVE_INFINITY; final double lower = 0; final Integrator1D<Double, Double> integrator = new GaussLaguerreQuadratureIntegrator1D(15); assertThat(0.5).isCloseTo(integrator.integrate(DF2, lower, upper), offset(EPS)); }
@Test public void testRungeKutta() { final RungeKuttaIntegrator1D integrator = new RungeKuttaIntegrator1D(); final double lower = -1; final double upper = 2; assertThat(F1.apply(upper) - F1.apply(lower)).isCloseTo(integrator.integrate(DF1, lower, upper), offset(EPS)); }
@Test public void testGaussJacobi() { final double upper = 12; final double lower = -1; final Integrator1D<Double, Double> integrator = new GaussJacobiQuadratureIntegrator1D(7); assertThat(F1.apply(upper) - F1.apply(lower)).isCloseTo(integrator.integrate(DF1, lower, upper), offset(EPS)); }