content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 13:29:22 GMT 2024
   */
  
  package org.apache.commons.math3.optim.univariate;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.runtime.EvoAssertions.*;
  import org.apache.commons.math3.optim.ConvergenceChecker;
  import org.apache.commons.math3.optim.univariate.BrentOptimizer;
  import org.apache.commons.math3.optim.univariate.UnivariatePointValuePair;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class BrentOptimizer_ESTest extends BrentOptimizer_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesBrentOptimizerTaking3Arguments() throws Throwable  {
        // Given: A Brent optimizer with a set of parameters and no convergence checker.
        BrentOptimizer brentOptimizer = new BrentOptimizer(1.5, 3.0, (ConvergenceChecker<UnivariatePointValuePair>) null);
        
        // When: We call the getGoalType() method on the optimizer.
        assertNull(brentOptimizer.getGoalType());
        
        // Then: The goal type is null, since no convergence checker was provided.
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDoOptimize() throws Throwable  {
        // rollbacked to evosuite
        BrentOptimizer brentOptimizer = new BrentOptimizer(2.0, 2.0);
        // Undeclared exception!
        try { 
          brentOptimizer.doOptimize();
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // illegal state: maximal count (0) exceeded: evaluations
           //
           verifyException("org.apache.commons.math3.optim.BaseOptimizer$MaxEvalCallback", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesBrentOptimizerTaking2Arguments0() throws Throwable  {
        // This test checks that the Brent optimizer throws an IllegalArgumentException
        // when the initial guess is smaller than or equal to the minimum.
        BrentOptimizer brentOptimizer = null;
        try {
        brentOptimizer = new BrentOptimizer(1892.536752994324, 0.0);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the correct exception is thrown
        verifyException("org.apache.commons.math3.optim.univariate.BrentOptimizer", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesBrentOptimizerTaking2Arguments1() throws Throwable  {
        // Test that BrentOptimizer throws an exception when the minimum is smaller than 0
        BrentOptimizer brentOptimizer = null;
        try {
        brentOptimizer = new BrentOptimizer(0.0, 0.0); // Create a new BrentOptimizer with minimum = 0 and maximum = 0
        fail("Expecting exception: IllegalArgumentException"); // Expect an IllegalArgumentException to be thrown
        } catch (IllegalArgumentException e) {
        // Verify that the exception is thrown as expected
        verifyException("org.apache.commons.math3.optim.univariate.BrentOptimizer", e);}
    }
  }
  