content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 17:18:06 GMT 2024
   */
  
  package org.apache.commons.math3.optim.nonlinear.scalar.noderiv;
  
  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.shaded.org.mockito.Mockito.*;
  import static org.evosuite.runtime.EvoAssertions.*;
  import java.util.Comparator;
  import org.apache.commons.math3.analysis.MultivariateFunction;
  import org.apache.commons.math3.optim.PointValuePair;
  import org.apache.commons.math3.optim.nonlinear.scalar.noderiv.MultiDirectionalSimplex;
  import org.apache.commons.math3.optim.nonlinear.scalar.noderiv.NelderMeadSimplex;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.ViolatedAssumptionAnswer;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class AbstractSimplex_Original_ESTest extends AbstractSimplex_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetSize() throws Throwable  {
        double[] arg0 = new double[1];
        arg0[0] = Double.NaN;
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
        multiDirectionalSimplex.build(arg0);
        int size = multiDirectionalSimplex.getSize();
        assertEquals(2, size);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPoints() throws Throwable  {
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(2);
        double[] arg0 = new double[2];
        multiDirectionalSimplex.build(arg0);
        PointValuePair[] points = multiDirectionalSimplex.getPoints();
        assertEquals(3, points.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDimensionReturningPositive() throws Throwable  {
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(104);
        int dimension = multiDirectionalSimplex.getDimension();
        assertEquals(104, dimension);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetPointWithPositiveAndNonNull() throws Throwable  {
        double[] arg0 = new double[1];
        arg0[0] = Double.NaN;
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
        multiDirectionalSimplex.build(arg0);
        PointValuePair arg1 = new PointValuePair(arg0, 2439.77302223);
        // Undeclared exception!
        try { 
          multiDirectionalSimplex.setPoint(1038, arg1);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // 1,038 out of [0, 1] range
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPointWithPositive() throws Throwable  {
        double[] arg0 = new double[1];
        arg0[0] = Double.NaN;
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
        multiDirectionalSimplex.build(arg0);
        // Undeclared exception!
        try { 
          multiDirectionalSimplex.getPoint(2);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // 2 out of [0, 1] range
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPoint() throws Throwable  {
        double[] arg0 = new double[1];
        arg0[0] = Double.NaN;
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
        multiDirectionalSimplex.build(arg0);
        multiDirectionalSimplex.getPoint(0);
        assertEquals(2, multiDirectionalSimplex.getSize());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPointThrowsNullPointerException() throws Throwable  {
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(95);
        // Undeclared exception!
        try { 
          multiDirectionalSimplex.getPoint((-1789));
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuildWithEmptyArray() throws Throwable  {
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(22);
        double[] arg0 = new double[0];
        // Undeclared exception!
        try { 
          multiDirectionalSimplex.build(arg0);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // 22 != 0
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test0() throws Throwable  {
        double[] doubleArray = new double[1];
        doubleArray[0] = Double.NaN;
        double[][] arg0 = new double[2][2];
        arg0[0] = doubleArray;
        arg0[1] = doubleArray;
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
        assertEquals(1, multiDirectionalSimplex.getDimension());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test1() throws Throwable  {
        double[] doubleArray = new double[4];
        double[][] arg0 = new double[5][5];
        arg0[0] = doubleArray;
        arg0[1] = doubleArray;
        MultiDirectionalSimplex multiDirectionalSimplex = null;
        try {
          multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // equal vertices 1 and 0 in simplex configuration
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDimensionReturningZero() throws Throwable  {
        double[][] arg0 = new double[1][0];
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
        int dimension = multiDirectionalSimplex.getDimension();
        assertEquals(0, dimension);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test2() throws Throwable  {
        double[][] arg0 = new double[0][1];
        NelderMeadSimplex nelderMeadSimplex = null;
        try {
          nelderMeadSimplex = new NelderMeadSimplex(arg0, Double.NaN, (-1.0), Double.NaN, Double.NaN);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // simplex must contain at least one point
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test3() throws Throwable  {
        double[][] arg0 = new double[2][2];
        MultiDirectionalSimplex multiDirectionalSimplex = null;
        try {
          multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // 2 != 1
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test4() throws Throwable  {
        double[] arg0 = new double[10];
        MultiDirectionalSimplex multiDirectionalSimplex = null;
        try {
          multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // equal vertices 0 and {1} in simplex configuration
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test5() throws Throwable  {
        NelderMeadSimplex nelderMeadSimplex = null;
        try {
          nelderMeadSimplex = new NelderMeadSimplex(0);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // zero not allowed here
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test6() throws Throwable  {
        NelderMeadSimplex nelderMeadSimplex = null;
        try {
          nelderMeadSimplex = new NelderMeadSimplex((double[]) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // null is not allowed
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testBuild() throws Throwable  {
        double[] arg0 = new double[1];
        arg0[0] = Double.NaN;
        MultiDirectionalSimplex multiDirectionalSimplex = new MultiDirectionalSimplex(arg0);
        multiDirectionalSimplex.build(arg0);
        Comparator<PointValuePair> arg1 = (Comparator<PointValuePair>) mock(Comparator.class, new ViolatedAssumptionAnswer());
        // Undeclared exception!
        try { 
          multiDirectionalSimplex.iterate((MultivariateFunction) null, arg1);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetPointThrowsNullPointerException() throws Throwable  {
        NelderMeadSimplex nelderMeadSimplex = new NelderMeadSimplex(101);
        // Undeclared exception!
        try { 
          nelderMeadSimplex.setPoint((-444), (PointValuePair) null);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.commons.math3.optim.nonlinear.scalar.noderiv.AbstractSimplex", e);
        }
    }
  }
  