@Test(expected = MaxEvaluationsExceededException.class)
public void testMaxEvaluations() throws MathException {
try {
Powell powell = new Powell();
NelderMead optimizer = new NelderMead();
optimizer.setConvergenceChecker(new SimpleRealPointChecker(-1.0, 1.0e-3));
optimizer.setMaxEvaluations(20);
optimizer.optimize(powell, GoalType.MINIMIZE, new double[] { 3.0, -1.0, 0.0, 1.0 });
} catch (FunctionEvaluationException fee) {
if (fee.getCause() instanceof ConvergenceException) {
throw (ConvergenceException) fee.getCause();