### Question:
IntegratorRepeated2D extends Integrator2D<Double, Double> { @Override public Double integrate(BiFunction<Double, Double, Double> f, Double[] lower, Double[] upper) { return _integrator1D.integrate(innerIntegral(f, lower[0], upper[0]), lower[1], upper[1]); } IntegratorRepeated2D(Integrator1D<Double, Double> integrator1D); @Override Double integrate(BiFunction<Double, Double, Double> f, Double[] lower, Double[] upper);  }### Answer:
@Test public void integrate() { BiFunction<Double, Double, Double> f = (x1, x2) -> x1 + Math.sin(x2); double absTol = 1.0E-6; double relTol = 1.0E-6; int minSteps = 6; RungeKuttaIntegrator1D integrator1D = new RungeKuttaIntegrator1D(absTol, relTol, minSteps); IntegratorRepeated2D integrator2D = new IntegratorRepeated2D(integrator1D); Double[] lower; Double[] upper; double result, resultExpected; lower = new Double[] {0.0, 1.0}; upper = new Double[] {2.0, 10.0}; result = integrator2D.integrate(f, lower, upper); resultExpected = (upper[0] * upper[0] - lower[0] * lower[0]) / 2.0 * (upper[1] - lower[1]) + (upper[0] - lower[0]) * (-Math.cos(upper[1]) + Math.cos(lower[1])); assertThat(result).as("Integration 2D - repeated 1D").isCloseTo(resultExpected, offset(1e-8)); lower = new Double[] {0.25, 5.25}; upper = new Double[] {25.25, 35.25}; result = integrator2D.integrate(f, lower, upper); resultExpected = (upper[0] * upper[0] - lower[0] * lower[0]) / 2.0 * (upper[1] - lower[1]) + (upper[0] - lower[0]) * (-Math.cos(upper[1]) + Math.cos(lower[1])); assertThat(result).as("Integration 2D - repeated 1D").isCloseTo(resultExpected, offset(1e-6)); }