public void testIntegratorControls() throws DerivativeException, IntegratorException {

    TestProblem3 pb = new TestProblem3(0.999);
    GraggBulirschStoerIntegrator integ =
        new GraggBulirschStoerIntegrator(
            0, pb.getFinalTime() - pb.getInitialTime(), 1.0e-8, 1.0e-10);

    double errorWithDefaultSettings = getMaxError(integ, pb);

    // stability control
    integ.setStabilityCheck(true, 2, 1, 0.99);
    assertTrue(errorWithDefaultSettings < getMaxError(integ, pb));
    integ.setStabilityCheck(true, -1, -1, -1);

    integ.setStepsizeControl(0.5, 0.99, 0.1, 2.5);
    assertTrue(errorWithDefaultSettings < getMaxError(integ, pb));
    integ.setStepsizeControl(-1, -1, -1, -1);

    integ.setOrderControl(10, 0.7, 0.95);
    assertTrue(errorWithDefaultSettings < getMaxError(integ, pb));
    integ.setOrderControl(-1, -1, -1);

    integ.setInterpolationControl(true, 3);
    assertTrue(errorWithDefaultSettings < getMaxError(integ, pb));
    integ.setInterpolationControl(true, -1);
  }
 public void testNullIntervalCheck() {
   try {
     TestProblem1 pb = new TestProblem1();
     GraggBulirschStoerIntegrator integrator =
         new GraggBulirschStoerIntegrator(0.0, 1.0, 1.0e-10, 1.0e-10);
     integrator.integrate(
         pb, 0.0, new double[pb.getDimension()], 0.0, new double[pb.getDimension()]);
     fail("an exception should have been thrown");
   } catch (DerivativeException de) {
     fail("wrong exception caught");
   } catch (IntegratorException ie) {
   }
 }