Buggy code:
public class LevenbergMarquardtOptimizerTest extends TestCase { public LevenbergMarquardtOptimizerTest ( String name ) { } public void testTrivial ( ) throws ObjectiveException , OptimizationException { } public void testQRColumnsPermutation ( ) throws ObjectiveException , OptimizationException { } public void testNoDependency ( ) throws ObjectiveException , OptimizationException { } public void testOneSet ( ) throws ObjectiveException , OptimizationException { } public void testTwoSets ( ) throws ObjectiveException , OptimizationException { } public void testNonInversible ( ) throws ObjectiveException , OptimizationException { } public void testIllConditioned ( ) throws ObjectiveException , OptimizationException { } public void testMoreEstimatedParametersSimple ( ) throws ObjectiveException , OptimizationException { } public void testMoreEstimatedParametersUnsorted ( ) throws ObjectiveException , OptimizationException { } public void testRedundantEquations ( ) throws ObjectiveException , OptimizationException { } public void testInconsistentEquations ( ) throws ObjectiveException , OptimizationException { } public void testInconsistentSizes ( ) throws ObjectiveException , OptimizationException { } public void testControlParameters ( ) throws OptimizationException { } private void checkEstimate ( VectorialDifferentiableObjectiveFunction problem , double initialStepBoundFactor , int maxCostEval , double costRelativeTolerance , double parRelativeTolerance , double orthoTolerance , boolean shouldFail ) { try { LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer ( ) ; optimizer . setInitialStepBoundFactor ( initialStepBoundFactor ) ; <START_BUG> optimizer . setMaxEvaluations ( maxCostEval ) ; <END_BUG> optimizer . setCostRelativeTolerance ( costRelativeTolerance ) ; optimizer . setParRelativeTolerance ( parRelativeTolerance ) ; optimizer . setOrthoTolerance ( orthoTolerance ) ; optimizer . optimize ( problem , new double [ ] { 0 , 0 , 0 , 0 , 0 } , new double [ ] { 1 , 1 , 1 , 1 , 1 } , new double [ ] { 98.68 , 47.345 } ) ; assertTrue ( ( ! shouldFail ) ) ; } catch ( OptimizationException ee ) { assertTrue ( shouldFail ) ; } catch ( ObjectiveException ee ) { assertTrue ( shouldFail ) ; } catch ( Exception e ) { fail ( "wrong<seq2seq4repair_space>exception<seq2seq4repair_space>type<seq2seq4repair_space>caught" ) ; } } public void testCircleFitting ( ) throws ObjectiveException , OptimizationException { } public void testCircleFittingBadInit ( ) throws ObjectiveException , OptimizationException { } public void testMath199 ( ) throws ObjectiveException , OptimizationException { } private static class LinearProblem implements VectorialDifferentiableObjectiveFunction { private static final long serialVersionUID = 703247177355019415L ; final RealMatrix factors ; final double [ ] target ; public LinearProblem ( double [ ] [ ] factors , double [ ] target ) { } public double [ ] [ ] jacobian ( double [ ] variables , double [ ] value ) { } public double [ ] objective ( double [ ] variables ) { } } private static class Circle implements VectorialDifferentiableObjectiveFunction { private static final long serialVersionUID = - 4711170319243817874L ; private ArrayList < Point2D . Double > points ; public Circle ( ) { } public void addPoint ( double px , double py ) { } public int getN ( ) { } public double getRadius ( Point2D . Double center ) { } public double [ ] [ ] jacobian ( double [ ] variables , double [ ] value ) throws IllegalArgumentException , ObjectiveException { } public double [ ] objective ( double [ ] variables ) throws IllegalArgumentException , ObjectiveException { } } private static class QuadraticProblem implements VectorialDifferentiableObjectiveFunction { private static final long serialVersionUID = - 247096133023967957L ; private List < Double > x ; private List < Double > y ; public QuadraticProblem ( ) { } public void addPoint ( double x , double y ) { } public double [ ] [ ] jacobian ( double [ ] variables , double [ ] value ) { } public double [ ] objective ( double [ ] variables ) { } } public static Test suite ( ) { } }

Fix:
optimizer . setMaxIterations ( maxCostEval ) ;