BrentMinimizer1D implements ScalarMinimizer { @Override public double minimize(final Function1D<Double, Double> function, final double startPosition, final double lowerBound, final double upperBound) { Validate.notNull(function, "function"); final UnivariateRealFunction commonsFunction = CommonsMathWrapper.wrapUnivariate(function); try { return OPTIMIZER.optimize(commonsFunction, MINIMIZE, lowerBound, upperBound, startPosition); } catch (final FunctionEvaluationException e) { throw new MathException(e); } catch (final org.apache.commons.math.ConvergenceException e) { throw new MathException(e); } }  @Override double minimize(final Function1D<Double, Double> function, final double startPosition, final double lowerBound, final double upperBound); @Override Double minimize(final Function1D<Double, Double> function, final Double startPosition);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullFunction1() { MINIMIZER.minimize(null, 2., 1., 4.); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullFunction2() { MINIMIZER.minimize(null, 2.); }