content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 11:58:58 GMT 2024
   */
  
  package org.apache.commons.collections4.list;
  
  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 java.util.Collection;
  import java.util.ConcurrentModificationException;
  import java.util.LinkedList;
  import java.util.ListIterator;
  import java.util.NoSuchElementException;
  import org.apache.commons.collections4.list.TreeList;
  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 TreeList_Original_ESTest extends TreeList_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNextIndex() throws Throwable  {
        TreeList<Integer> arg0 = new TreeList<Integer>();
        TreeList.TreeListIterator<Integer> treeList_TreeListIterator = new TreeList.TreeListIterator<Integer>(arg0, 270);
        int nextIndex = treeList_TreeListIterator.nextIndex();
        assertEquals(270, nextIndex);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCheckModCount() throws Throwable  {
        TreeList<Object> arg0 = new TreeList<Object>();
        TreeList.TreeListIterator<Object> treeList_TreeListIterator = new TreeList.TreeListIterator<Object>(arg0, (-779));
        treeList_TreeListIterator.checkModCount();
        assertTrue(treeList_TreeListIterator.hasNext());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSize() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        TreeList<Integer> treeList = new TreeList<Integer>(arg0);
        int size = treeList.size();
        assertFalse(treeList.contains(size));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetTaking2Arguments() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        TreeList<Integer> arg1 = new TreeList<Integer>(arg0);
        TreeList<Object> treeList = new TreeList<Object>(arg1);
        treeList.set(0, arg1);
        TreeList set = (TreeList)treeList.set(0, (Object) null);
        assertEquals(1, set.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testListIteratorTakingInt() throws Throwable  {
        TreeList<Integer> treeList = new TreeList<Integer>();
        ListIterator<Integer> listIterator = treeList.listIterator(0);
        assertFalse(listIterator.hasNext());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToArrayReturningNonEmptyArray() throws Throwable  {
        LinkedList<Integer> arg1 = new LinkedList<Integer>();
        arg1.add((Integer) null);
        arg1.addAll((Collection<? extends Integer>) arg1);
        TreeList<Integer> treeList = new TreeList<Integer>(arg1);
        treeList.add((Integer) null);
        treeList.addAll(1, (Collection<? extends Integer>) arg1);
        Object[] array = treeList.toArray();
        assertEquals(5, array.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetTakingObject() throws Throwable  {
        TreeList<Object> arg0 = new TreeList<Object>();
        TreeList.TreeListIterator<Object> treeList_TreeListIterator = new TreeList.TreeListIterator<Object>(arg0, (-779));
        // Undeclared exception!
        try { 
          treeList_TreeListIterator.set(arg0);
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.commons.collections4.list.TreeList$TreeListIterator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveTakingNoArguments() throws Throwable  {
        TreeList<Integer> arg0 = new TreeList<Integer>();
        TreeList.TreeListIterator<Integer> treeList_TreeListIterator = new TreeList.TreeListIterator<Integer>(arg0, (-11));
        // Undeclared exception!
        try { 
          treeList_TreeListIterator.remove();
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.commons.collections4.list.TreeList$TreeListIterator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrevious() throws Throwable  {
        TreeList<Integer> arg0 = new TreeList<Integer>();
        TreeList.TreeListIterator<Integer> treeList_TreeListIterator = new TreeList.TreeListIterator<Integer>(arg0, (-1333));
        // Undeclared exception!
        try { 
          treeList_TreeListIterator.previous();
          fail("Expecting exception: NoSuchElementException");
        
        } catch(NoSuchElementException e) {
           //
           // Already at start of list.
           //
           verifyException("org.apache.commons.collections4.list.TreeList$TreeListIterator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddAll() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        treeList.addAll((Collection<?>) arg0);
        assertEquals(2, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveTakingIntWithZero() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        arg0.addAll((Collection<? extends Integer>) arg0);
        arg0.add((Integer) null);
        arg0.removeFirstOccurrence((Object) null);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        treeList.remove(0);
        treeList.addAll((Collection<?>) arg0);
        assertEquals(3, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddAllAndRemoveTakingInt0() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        arg0.addAll((Collection<? extends Integer>) arg0);
        arg0.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        treeList.addAll((Collection<?>) arg0);
        treeList.remove(1);
        assertEquals(5, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveTakingInt0() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        arg0.addAll((Collection<? extends Integer>) arg0);
        arg0.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        treeList.remove(1);
        assertEquals(2, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveTakingInt1() throws Throwable  {
        LinkedList<Integer> arg1 = new LinkedList<Integer>();
        arg1.add((Integer) null);
        arg1.addAll((Collection<? extends Integer>) arg1);
        arg1.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg1);
        treeList.addAll(1, (Collection<?>) arg1);
        Object remove = treeList.remove(1);
        assertNull(remove);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveTakingInt2() throws Throwable  {
        LinkedList<Integer> arg1 = new LinkedList<Integer>();
        arg1.add((Integer) null);
        arg1.add((Integer) null);
        TreeList<Object> arg0 = new TreeList<Object>(arg1);
        arg1.add((Integer) null);
        arg0.addAll(0, (Collection<?>) arg1);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        Object remove = treeList.remove(2);
        assertNull(remove);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveTakingInt3() throws Throwable  {
        LinkedList<Integer> arg1 = new LinkedList<Integer>();
        arg1.add((Integer) null);
        arg1.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg1);
        treeList.addAll(1, (Collection<?>) arg1);
        treeList.remove(1);
        assertEquals(3, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveTakingInt4() throws Throwable  {
        LinkedList<Integer> arg1 = new LinkedList<Integer>();
        arg1.add((Integer) null);
        arg1.add((Integer) null);
        arg1.addAll((Collection<? extends Integer>) arg1);
        TreeList<Object> treeList = new TreeList<Object>(arg1);
        treeList.addAll(1, (Collection<?>) arg1);
        treeList.remove(1);
        assertEquals(7, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGet() throws Throwable  {
        TreeList<Object> treeList = new TreeList<Object>();
        Object arg0 = new Object();
        treeList.add(arg0);
        treeList.add(arg0);
        treeList.get(1);
        assertEquals(2, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesTreeListTakingCollection0() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        arg0.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        int lastIndexOf = treeList.lastIndexOf(arg0);
        assertEquals((-1), lastIndexOf);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveTakingInt5() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        arg0.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        treeList.remove(1);
        assertEquals(1, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesTreeListTakingCollection1() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        arg0.add((Integer) null);
        arg0.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        int lastIndexOf = treeList.lastIndexOf(arg0);
        assertEquals((-1), lastIndexOf);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testListIteratorTakingIntThrowsIndexOutOfBoundsException() throws Throwable  {
        TreeList<Object> treeList = new TreeList<Object>();
        // Undeclared exception!
        try { 
          treeList.listIterator((-1));
          fail("Expecting exception: IndexOutOfBoundsException");
        
        } catch(IndexOutOfBoundsException e) {
           //
           // Invalid index:-1, size=0
           //
           verifyException("org.apache.commons.collections4.list.TreeList", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAdd() throws Throwable  {
        LinkedList<Integer> arg1 = new LinkedList<Integer>();
        TreeList<Object> treeList = new TreeList<Object>(arg1);
        treeList.add(0, (Object) arg1);
        assertEquals(1, treeList.size());
        
        treeList.remove(0);
        assertEquals(0, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToArrayReturningEmptyArray() throws Throwable  {
        TreeList<Integer> treeList = new TreeList<Integer>();
        Object[] array = treeList.toArray();
        assertEquals(0, array.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddAllAndRemoveTakingInt1() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        arg0.add((Integer) null);
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        treeList.addAll((Collection<?>) arg0);
        treeList.remove(1);
        assertEquals(3, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesTreeListTakingCollection2() throws Throwable  {
        LinkedList<Integer> arg1 = new LinkedList<Integer>();
        Integer arg0 = new Integer(0);
        arg1.add(arg0);
        TreeList<Integer> treeList = new TreeList<Integer>(arg1);
        treeList.addAll(0, (Collection<? extends Integer>) arg1);
        treeList.addAll(0, (Collection<? extends Integer>) arg1);
        assertEquals(3, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesTreeListTakingCollection3() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        arg0.add((Integer) null);
        TreeList<Integer> arg1 = new TreeList<Integer>(arg0);
        // Undeclared exception!
        try { 
          arg1.addAll(0, (Collection<? extends Integer>) arg1);
          fail("Expecting exception: ConcurrentModificationException");
        
        } catch(ConcurrentModificationException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.apache.commons.collections4.list.TreeList$TreeListIterator", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPreviousIndex() throws Throwable  {
        TreeList<Object> arg0 = new TreeList<Object>();
        TreeList.TreeListIterator<Object> treeList_TreeListIterator = new TreeList.TreeListIterator<Object>(arg0, (-1));
        int previousIndex = treeList_TreeListIterator.previousIndex();
        assertEquals((-2), previousIndex);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClear() throws Throwable  {
        LinkedList<Object> arg0 = new LinkedList<Object>();
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        treeList.clear();
        assertEquals(0, treeList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testListIteratorTakingNoArguments() throws Throwable  {
        LinkedList<Integer> arg0 = new LinkedList<Integer>();
        TreeList<Object> treeList = new TreeList<Object>(arg0);
        ListIterator<Object> listIterator = treeList.listIterator();
        assertFalse(listIterator.hasNext());
        assertFalse(listIterator.hasPrevious());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIterator() throws Throwable  {
        TreeList<Integer> treeList = new TreeList<Integer>();
        treeList.iterator();
        assertEquals(0, treeList.size());
    }
  }
  