EventState es = new EventState(closeEventsGenerator, 1.5 * gap,
tolerance, 100,
new BrentSolver(tolerance));
AbstractStepInterpolator interpolator =
new DummyStepInterpolator(new double[0], new double[0], true);
interpolator.storeTime(r1 - 2.5 * gap);
interpolator.shift();
interpolator.storeTime(r1 - 1.5 * gap);
es.reinitializeBegin(interpolator);
interpolator.shift();
interpolator.storeTime(r1 - 0.5 * gap);
Assert.assertFalse(es.evaluateStep(interpolator));
interpolator.shift();
interpolator.storeTime(0.5 * (r1 + r2));
Assert.assertTrue(es.evaluateStep(interpolator));
Assert.assertEquals(r1, es.getEventTime(), tolerance);
es.stepAccepted(es.getEventTime(), new double[0]);
interpolator.shift();
interpolator.storeTime(r2 + 0.4 * gap);
Assert.assertTrue(es.evaluateStep(interpolator));
Assert.assertEquals(r2, es.getEventTime(), tolerance);
}