content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 13:24:42 GMT 2024
   */
  
  package org.apache.commons.math3.analysis;
  
  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.analysis.BivariateFunction;
  import org.apache.commons.math3.analysis.FunctionUtils;
  import org.apache.commons.math3.analysis.MultivariateFunction;
  import org.apache.commons.math3.analysis.UnivariateFunction;
  import org.apache.commons.math3.analysis.function.Add;
  import org.apache.commons.math3.analysis.function.Divide;
  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 FunctionUtils_ESTest extends FunctionUtils_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSampleWithNullAndNegative() throws Throwable  {
        UnivariateFunction[] univariateFunctionArray = new UnivariateFunction[7];
        try {
        FunctionUtils.sample(univariateFunctionArray[0], 132, -2093, 132);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Expected exception
        assertEquals(-2093, e.getMessage().length());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCollectorTaking2Arguments() throws Throwable  {
        // Given: The Divide class has been instantiated and a collector is being created using the FunctionUtils class
        Divide arg0 = new Divide();
        MultivariateFunction collector = FunctionUtils.collector((BivariateFunction) arg0, (-1425.045064177));
        
        // When: The collector has been instantiated and the method has been called
        assertNotNull(collector);
        
        // Then: The collector should not be null, as it is a valid instance of MultivariateFunction
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSampleThrowsNullPointerException() throws Throwable  {
        // No Comments were added
        UnivariateFunction arg0 = FunctionUtils.fix1stArgument((BivariateFunction) null, 361.75107562072805);
        // Undeclared exception!
        try { 
          FunctionUtils.sample(arg0, 0.680370569229126, 361.75107562072805, 191);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.commons.math3.analysis.FunctionUtils$12", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCollectorTaking3ArgumentsAndFix2ndArgument() throws Throwable  {
        // Create a new instance of the Add class
        Add add = new Add();
        
        // Fix the second argument to be 554.0
        UnivariateFunction fixedAdd = FunctionUtils.fix2ndArgument(add, 554.0);
        
        // Collect the results of the Add function using a collector
        MultivariateFunction collector = FunctionUtils.collector((BivariateFunction) add, fixedAdd, 554.0);
        
        // Assert that the collector is not null
        assertNotNull(collector);
    }
  }
  