ContinuousOutputModel implements StepHandler, Serializable { public void handleStep(final StepInterpolator interpolator, final boolean isLast) throws MaxCountExceededException { if (steps.size() == 0) { initialTime = interpolator.getPreviousTime(); forward = interpolator.isForward(); } steps.add(interpolator.copy()); if (isLast) { finalTime = interpolator.getCurrentTime(); index = steps.size() - 1; } } ContinuousOutputModel(); void append(final ContinuousOutputModel model); void init(double t0, double[] y0, double t); void handleStep(final StepInterpolator interpolator, final boolean isLast); double getInitialTime(); double getFinalTime(); double getInterpolatedTime(); void setInterpolatedTime(final double time); double[] getInterpolatedState(); double[] getInterpolatedDerivatives(); double[] getInterpolatedSecondaryState(final int secondaryStateIndex); double[] getInterpolatedSecondaryDerivatives(final int secondaryStateIndex);  }
@Test public void testErrorConditions() throws MaxCountExceededException, MathIllegalArgumentException { ContinuousOutputModel cm = new ContinuousOutputModel(); cm.handleStep(buildInterpolator(0, new double[] { 0.0, 1.0, -2.0 }, 1), true); Assert.assertTrue(checkAppendError(cm, 1.0, new double[] { 0.0, 1.0 }, 2.0)); Assert.assertTrue(checkAppendError(cm, 10.0, new double[] { 0.0, 1.0, -2.0 }, 20.0)); Assert.assertTrue(checkAppendError(cm, 1.0, new double[] { 0.0, 1.0, -2.0 }, 0.0)); Assert.assertFalse(checkAppendError(cm, 1.0, new double[] { 0.0, 1.0, -2.0 }, 2.0)); }