EvaluationRmsChecker implements ConvergenceChecker<Evaluation> { public boolean converged(final int iteration, final Evaluation previous, final Evaluation current) { final double prevRms = previous.getRMS(); final double currRms = current.getRMS(); return Precision.equals(prevRms, currRms, this.absTol) || Precision.equalsWithRelativeTolerance(prevRms, currRms, this.relTol); } EvaluationRmsChecker(final double tol);  EvaluationRmsChecker(final double relTol, final double absTol); boolean converged(final int iteration,
                             final Evaluation previous,
                             final Evaluation current);  }
@Test public void testConverged() { ConvergenceChecker<Evaluation> checker = new EvaluationRmsChecker(0.1, 1); Evaluation e200 = mockEvaluation(200); Evaluation e1 = mockEvaluation(1); Assert.assertEquals(true, checker.converged(0, e200, mockEvaluation(210))); Assert.assertEquals(true, checker.converged(0, e1, mockEvaluation(1.9))); Assert.assertEquals(true, checker.converged(0, e1, mockEvaluation(1.01))); Assert.assertEquals(false, checker.converged(0, e200, mockEvaluation(300))); }