content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 17:13:59 GMT 2024
   */
  
  package net.sf.javaml.core;
  
  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.function.Consumer;
  import net.sf.javaml.core.AbstractInstance;
  import net.sf.javaml.core.DenseInstance;
  import net.sf.javaml.core.Instance;
  import net.sf.javaml.core.SparseInstance;
  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 AbstractInstance_Original_ESTest extends AbstractInstance_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCode() throws Throwable  {
        Object arg1 = new Object();
        SparseInstance sparseInstance = new SparseInstance((-1), arg1);
        sparseInstance.hashCode();
        assertEquals(0, sparseInstance.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSqrtReturningInstanceWhereGetIDIsZero() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance();
        AbstractInstance.nextID = 0;
        Instance sqrt = sparseInstance.sqrt();
        assertEquals(0, sqrt.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSqrtReturningInstanceWhereGetIDIsNegative() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance();
        AbstractInstance.nextID = (-1);
        Instance sqrt = sparseInstance.sqrt();
        assertEquals((-1), sqrt.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingInstanceReturningInstanceWhereGetIDIsNegative() throws Throwable  {
        DenseInstance arg0 = new DenseInstance(1727);
        AbstractInstance.nextID = (-2);
        SparseInstance sparseInstance = new SparseInstance((-2));
        Instance multiply = sparseInstance.multiply((Instance) arg0);
        assertEquals((-1), multiply.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingDoubleReturningInstanceWhereGetIDIsZero() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance();
        AbstractInstance.nextID = 0;
        Instance multiply = sparseInstance.multiply(0.0);
        assertEquals(0, multiply.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMinusTakingDoubleReturningInstanceWhereGetIDIsZero() throws Throwable  {
        double[] arg0 = new double[4];
        Object arg1 = new Object();
        SparseInstance sparseInstance = new SparseInstance(arg0, arg1);
        AbstractInstance.nextID = 0;
        Instance minus = sparseInstance.minus((-2318.903));
        assertEquals(0, minus.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEquals() throws Throwable  {
        SparseInstance arg0 = new SparseInstance();
        arg0.equals(arg0);
        assertEquals(0, arg0.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingInstance() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance();
        DenseInstance arg0 = new DenseInstance(0);
        AbstractInstance.nextID = 0;
        Instance divide = sparseInstance.divide((Instance) arg0);
        assertNotSame(divide, arg0);
        assertEquals(1, arg0.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingDoubleReturningInstanceWhereGetIDIsZero() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance();
        AbstractInstance.nextID = 0;
        Instance divide = sparseInstance.divide((-4377.996363608));
        assertEquals(0, divide.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClassValueReturningNull() throws Throwable  {
        double[] arg0 = new double[3];
        SparseInstance sparseInstance = new SparseInstance(arg0, (Object) null);
        sparseInstance.classValue();
        assertEquals(0, sparseInstance.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClassValueReturningNonNull() throws Throwable  {
        double[] arg0 = new double[0];
        Object arg1 = new Object();
        SparseInstance sparseInstance = new SparseInstance(arg0, arg1);
        sparseInstance.classValue();
        assertEquals(0, sparseInstance.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSqrtReturningInstanceWhereGetIDIsPositive() throws Throwable  {
        DenseInstance denseInstance = new DenseInstance(31);
        Instance sqrt = denseInstance.sqrt();
        assertEquals(1, sqrt.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingInstance() throws Throwable  {
        SparseInstance arg0 = new SparseInstance();
        Instance add = arg0.add((Instance) arg0);
        assertEquals(1, add.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingDouble() throws Throwable  {
        Object arg1 = new Object();
        SparseInstance sparseInstance = new SparseInstance((-1), arg1);
        Instance add = sparseInstance.add((double) (-1));
        assertEquals(1, add.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingInstanceReturningInstanceWhereGetIDIsPositive() throws Throwable  {
        DenseInstance arg0 = new DenseInstance(1727);
        Instance multiply = arg0.multiply((Instance) arg0);
        assertTrue(multiply.equals((Object)arg0));
        assertEquals(1, multiply.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingDoubleReturningInstanceWhereGetIDIsPositive() throws Throwable  {
        DenseInstance denseInstance = new DenseInstance(882);
        Instance multiply = denseInstance.multiply((double) 882);
        assertEquals(1, multiply.getID());
        assertTrue(multiply.equals((Object)denseInstance));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingDoubleReturningInstanceWhereGetIDIsPositive() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance(4993);
        Instance divide = sparseInstance.divide((double) 4993);
        assertEquals(1, divide.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMinusTakingDouble() throws Throwable  {
        double[] arg0 = new double[4];
        Object arg1 = new Object();
        SparseInstance sparseInstance = new SparseInstance(arg0, arg1);
        Instance minus = sparseInstance.minus((-2318.903));
        assertEquals(1, minus.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMinusTakingDoubleReturningInstanceWhereSizeIsZero() throws Throwable  {
        DenseInstance denseInstance = new DenseInstance(0);
        Instance minus = denseInstance.minus((double) 0);
        assertEquals(1, minus.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMinusTakingInstance() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance((-1), (-1));
        Instance minus = sparseInstance.minus((Instance) null);
        assertEquals(1, minus.getID());
        assertNotNull(minus);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test0() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance();
        Consumer<Object> arg0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());
        sparseInstance.forEach(arg0);
        assertEquals(0, sparseInstance.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test1() throws Throwable  {
        double[] arg0 = new double[7];
        DenseInstance denseInstance = new DenseInstance(arg0);
        Instance copy = denseInstance.copy();
        assertEquals(1, copy.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNext() throws Throwable  {
        SparseInstance arg0 = new SparseInstance();
        AbstractInstance.InstanceValueIterator abstractInstance_InstanceValueIterator = arg0.new InstanceValueIterator();
        abstractInstance_InstanceValueIterator.next();
        assertEquals(0, arg0.getID());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemove() throws Throwable  {
        SparseInstance arg0 = new SparseInstance();
        AbstractInstance.InstanceValueIterator abstractInstance_InstanceValueIterator = arg0.new InstanceValueIterator();
        // Undeclared exception!
        try { 
          abstractInstance_InstanceValueIterator.remove();
          fail("Expecting exception: UnsupportedOperationException");
        
        } catch(UnsupportedOperationException e) {
           //
           // Cannot remove from instance using the iterator.
           //
           verifyException("net.sf.javaml.core.AbstractInstance$InstanceValueIterator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIterator() throws Throwable  {
        SparseInstance sparseInstance = new SparseInstance();
        sparseInstance.iterator();
        assertEquals(0, sparseInstance.getID());
    }
  }
  