content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 17:29:32 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 java.util.Collection;
  import java.util.LinkedHashSet;
  import java.util.Set;
  import java.util.SortedSet;
  import net.sf.javaml.core.Dataset;
  import net.sf.javaml.core.DefaultDataset;
  import net.sf.javaml.core.DenseInstance;
  import net.sf.javaml.core.Instance;
  import net.sf.javaml.core.SparseInstance;
  import net.sf.javaml.distance.EuclideanDistance;
  import net.sf.javaml.distance.SpearmanFootruleDistance;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.mock.java.util.MockRandom;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class DefaultDataset_Original_ESTest extends DefaultDataset_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testInstanceReturningNull() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        defaultDataset.setSize(1778);
        Instance instance = defaultDataset.instance(1766);
        assertNull(instance);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddAllTakingCollection() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        LinkedHashSet<SparseInstance> arg0 = new LinkedHashSet<SparseInstance>();
        boolean addAll = defaultDataset.addAll((Collection<? extends Instance>) arg0);
        assertFalse(addAll);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCopy() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        Dataset copy = defaultDataset.copy();
        assertNotSame(copy, defaultDataset);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClassValue() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        Object classValue = defaultDataset.classValue(11);
        assertNull(classValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClassIndexReturningZero() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        Double arg0 = new Double(4365.9);
        int classIndex = defaultDataset.classIndex(arg0);
        assertEquals(0, classIndex);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClassIndexReturningNegative() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        int classIndex = defaultDataset.classIndex((Object) null);
        assertEquals((-1), classIndex);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNoAttributes() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        int noAttributes = defaultDataset.noAttributes();
        assertEquals(0, noAttributes);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFolds() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        SparseInstance arg0 = new SparseInstance();
        defaultDataset.add((Instance) arg0);
        MockRandom arg1 = new MockRandom();
        Dataset[] folds = defaultDataset.folds(2159, arg1);
        assertEquals(2159, folds.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingInstanceWithNonEmptyMap() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        DenseInstance arg0 = new DenseInstance(8);
        defaultDataset.add((Instance) arg0);
        SparseInstance arg1 = new SparseInstance();
        EuclideanDistance arg2 = new EuclideanDistance();
        Set<Instance> kNearest = defaultDataset.kNearest(8, arg1, arg2);
        assertEquals(1, kNearest.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testKNearestWithNegativeAndNonEmptyMap() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        double[] arg0 = new double[1];
        DenseInstance arg1 = new DenseInstance(arg0);
        defaultDataset.add((Instance) arg1);
        SpearmanFootruleDistance arg2 = new SpearmanFootruleDistance();
        Set<Instance> kNearest = defaultDataset.kNearest((-1849), arg1, arg2);
        assertEquals(0, kNearest.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingInstanceWithEmptyMap() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        SparseInstance arg1 = new SparseInstance();
        defaultDataset.add((Instance) arg1);
        EuclideanDistance arg2 = new EuclideanDistance();
        Set<Instance> kNearest = defaultDataset.kNearest(14, arg1, arg2);
        assertTrue(kNearest.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClasses() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        SortedSet<Object> classes = defaultDataset.classes();
        assertTrue(classes.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClear() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        defaultDataset.clear();
        assertEquals("[]", defaultDataset.toString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTaking2Arguments() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        DenseInstance arg1 = new DenseInstance(0);
        defaultDataset.add(0, (Instance) arg1);
        Instance instance = defaultDataset.instance(0);
        assertEquals(0, instance.noAttributes());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddAllTaking2Arguments() throws Throwable  {
        DefaultDataset arg1 = new DefaultDataset();
        boolean addAll = arg1.addAll(0, (Collection<? extends Instance>) arg1);
        assertFalse(addAll);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testInstanceReturningInstanceWhereIsEmptyIsTrue() throws Throwable  {
        DefaultDataset defaultDataset = new DefaultDataset();
        SparseInstance arg0 = new SparseInstance(0);
        defaultDataset.add((Instance) arg0);
        Instance instance = defaultDataset.instance(0);
        assertSame(instance, arg0);
    }
  }
  