@Test
public void testKeepInitIfBest() {
final double minSin = 3 * Math.PI / 2;
final double offset = 1e-8;
final double delta = 1e-7;
final UnivariateFunction f1 = new Sin();
final UnivariateFunction f2 = new StepFunction(new double[] { minSin, minSin + offset, minSin + 2 * offset},
new double[] { 0, -1, 0 });
final UnivariateFunction f = FunctionUtils.add(f1, f2);
// A slightly less stringent tolerance would make the test pass
// even with the previous implementation.