### Question:
AdaptiveCompositeIntegrator1D extends Integrator1D<Double, Double> { @Override public Double integrate(Function<Double, Double> f, Double lower, Double upper) { ArgChecker.notNull(f, "f"); ArgChecker.notNull(lower, "lower bound"); ArgChecker.notNull(upper, "upper bound"); try { if (lower < upper) { return integration(f, lower, upper); } log.info("Upper bound was less than lower bound; swapping bounds and negating result"); return -integration(f, upper, lower); } catch (Exception e) { throw new IllegalStateException("function evaluation returned NaN or Inf"); } } AdaptiveCompositeIntegrator1D(Integrator1D<Double, Double> integrator);  AdaptiveCompositeIntegrator1D(Integrator1D<Double, Double> integrator, double gain, double tol); @Override Double integrate(Function<Double, Double> f, Double lower, Double upper); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void sampleDataTest() { final Integrator1D<Double, Double> localInt = new AdaptiveCompositeIntegrator1D(new SimpsonIntegrator1D(), 10., 1.e-4); assertThat(-0.368924186060527).isCloseTo(localInt.integrate(sampleFunc(), 1.1, 3.), offset(1.e-6)); }