content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 05:36:04 GMT 2024
   */
  
  package bible.util;
  
  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 bible.util.Queue;
  import java.util.Vector;
  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 Queue_ESTest extends Queue_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPeakNumberItemsReturningPositive() throws Throwable  {
        // rollbacked to evosuite
        Queue queue = new Queue((-3338));
        Object arg0 = new Object();
        queue.enqueue(arg0);
        int peakNumberItems = queue.getPeakNumberItems();
        assertFalse(queue.isEmpty());
        assertEquals(1, peakNumberItems);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNumberItemsReturningPositive() throws Throwable  {
        // Given: A Queue with 1417 elements and an Object to be refreshed
        Queue queue = new Queue(1417);
        Object arg0 = new Object();
        
        // When: Refreshing the element in the Queue
        queue.refreshElement(arg0);
        
        // Then: The number of items in the Queue should not be zero, and it should equal 1
        assertFalse(queue.isEmpty());
        int numberItems = queue.getNumberItems();
        assertEquals(1, numberItems);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemove() throws Throwable  {
        Queue queue = new Queue();
        //Create a new instance of the Queue class and add an object to it
        Object arg0 = new Object();
        queue.enqueue(arg0);
        //Assert that the queue is not empty after adding the object
        assertFalse(queue.isEmpty());
        
        int remove = queue.remove(arg0);
        //Assert that the number of elements removed from the queue is equal to 1
        assertEquals(1, remove);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsEmptyReturningFalse() throws Throwable  {
        // rollbacked to evosuite
        Queue queue = new Queue((-1));
        Object arg0 = new Object();
        queue.refreshElement(arg0);
        boolean empty = queue.isEmpty();
        assertFalse(empty);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsEmptyReturningTrue() throws Throwable  {
        // Create a new queue and assert that it is empty
        Queue queue = new Queue();
        assertTrue(queue.isEmpty());
        
        // Assert that the peak number of items in the queue is 0
        assertEquals(0, queue.getPeakNumberItems());
        
        // Assert that the current number of items in the queue is 0
        assertEquals(0, queue.getNumberItems());
        
        // Assert that the maximum capacity of the queue has not been exceeded
        assertFalse(queue.maxCapacityExceeded());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesNodeTaking2Arguments() throws Throwable  {
        // Given
        Queue arg1 = new Queue();
        
        // When
        Queue.Node queue_Node = arg1.new Node(arg1);
        
        // Then
        assertFalse(arg1.maxCapacityExceeded());
        assertEquals(0, arg1.getNumberItems());
        assertEquals(0, arg1.getPeakNumberItems());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMaxCapacityExceededReturningFalse() throws Throwable  {
        // Given: A new Queue instance with no items
        Queue queue = new Queue();
        
        // When: The queue is checked for maximum capacity exceedance
        boolean maxCapacityExceeded = queue.maxCapacityExceeded();
        
        // Then: The maximum capacity has not been exceeded and the number of items in the queue is 0
        assertFalse(maxCapacityExceeded);
        assertEquals(0, queue.getNumberItems());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMaxCapacityExceededReturningTrue() throws Throwable  {
        // No Comments were added
        Queue queue = new Queue((-3338));
        boolean maxCapacityExceeded = queue.maxCapacityExceeded();
        assertEquals(0, queue.getNumberItems());
        assertTrue(maxCapacityExceeded);
        assertEquals(0, queue.getPeakNumberItems());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDequeue() throws Throwable  {
        // No Comments were added
        Queue queue = new Queue();
        queue.dequeue();
        queue.dequeue();
        boolean maxCapacityExceeded = queue.maxCapacityExceeded();
        assertEquals((-2), queue.getNumberItems());
        assertFalse(maxCapacityExceeded);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDequeueReturningNonNull() throws Throwable  {
        // Given a queue with capacity -3338
        Queue queue = new Queue((-3338));
        
        // When we enqueue an object and then another object
        Object arg0 = new Object();
        queue.enqueue(arg0);
        queue.enqueue(arg0);
        
        // Then the dequeued object should not be empty
        assertFalse(queue.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNumberItemsReturningNegative() throws Throwable  {
        // rollbacked to evosuite
        Queue queue = new Queue(0);
        queue.dequeue();
        int numberItems = queue.getNumberItems();
        assertFalse(queue.maxCapacityExceeded());
        assertEquals((-1), numberItems);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEnqueueWithNull() throws Throwable  {
        // Given an empty queue with a max capacity of 0
        Queue queue = new Queue(0);
        
        // When we enqueue a null object
        queue.enqueue((Object) null);
        
        // Then the number of items in the queue should be 0
        assertEquals(0, queue.getNumberItems());
        
        // And the peak number of items in the queue should also be 0
        assertEquals(0, queue.getPeakNumberItems());
        
        // And the max capacity exceeded flag should be true
        assertTrue(queue.maxCapacityExceeded());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPeakNumberItemsReturningZero() throws Throwable  {
        // Given a queue with a maximum capacity of -3338
        Queue queue = new Queue(-3338);
        
        // When the number of items in the queue exceeds the maximum capacity
        int peakNumberItems = queue.getPeakNumberItems();
        assertTrue(queue.maxCapacityExceeded());
        
        // Then the queue is considered full and no more items can be added
        assertEquals(0, queue.getNumberItems());
        assertEquals(0, peakNumberItems);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetObjects() throws Throwable  {
        // Given: a non-empty queue with one item
        Queue queue = new Queue();
        Vector arg0 = queue.getObjects();
        
        // When: refreshElement is called with a valid argument (the vector containing the single item)
        queue.refreshElement(arg0);
        
        // Then: the number of items in the queue should remain the same, but the element should be updated
        assertEquals(1, queue.getNumberItems());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNumberItemsReturningZero() throws Throwable  {
        // rollbacked to evosuite
        Queue queue = new Queue();
        int numberItems = queue.getNumberItems();
        assertEquals(0, queue.getPeakNumberItems());
        assertEquals(0, numberItems);
        assertFalse(queue.maxCapacityExceeded());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToString() throws Throwable  {
        // Given: we have a Queue object with a negative maximum capacity of -3338.
        Queue queue = new Queue((-3338));
        
        // When: the toString() method is called on the queue.
        String string = queue.toString();
        
        // Then: the resulting String should be a valid representation of the queue, including its current number of items and maximum capacity.
        assertEquals("bible.util.Queue:[numItems=0, maxNumItems=0, maxCapacity=-3338, getObjects()=[]\r\n]", string);
    }
  }
  