content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 20:39:30 GMT 2024
   */
  
  package org.jfree.data.time;
  
  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.io.InputStream;
  import java.math.BigInteger;
  import java.time.chrono.ChronoLocalDate;
  import javax.swing.JTable;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.mock.java.util.MockDate;
  import org.jfree.data.time.Day;
  import org.jfree.data.time.FixedMillisecond;
  import org.jfree.data.time.Hour;
  import org.jfree.data.time.Millisecond;
  import org.jfree.data.time.Minute;
  import org.jfree.data.time.Quarter;
  import org.jfree.data.time.RegularTimePeriod;
  import org.jfree.data.time.Second;
  import org.jfree.data.time.TimeSeries;
  import org.jfree.data.time.TimeSeriesDataItem;
  import org.jfree.data.time.Week;
  import org.jfree.data.xy.XYDatasetTableModel;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class TimeSeries_ESTest extends TimeSeries_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetTimePeriodClassReturningClassWhereIsEnumIsTrue() throws Throwable  {
        // Create a new TimeSeries instance with the PrintMode class as an argument
        Class<JTable.PrintMode> arg1 = JTable.PrintMode.class;
        TimeSeries timeSeries = new TimeSeries("", arg1);
        
        // Assert that getTimePeriodClass() returns the maximum item count for the TimeSeries instance
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        
        // Assert that getRangeDescription() returns "Value" for the TimeSeries instance
        assertEquals("Value", timeSeries.getRangeDescription());
        
        // Assert that getDomainDescription() returns "Time" for the TimeSeries instance
        assertEquals("Time", timeSeries.getDomainDescription());
        
        // Assert that getMaximumItemAge() returns 9223372036854775807L (Long.MAX_VALUE) for the TimeSeries instance
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetRangeDescriptionReturningNull() throws Throwable  {
        // No Comments were added
        Class<Object> arg3 = Object.class;
        TimeSeries timeSeries = new TimeSeries("org.jfree.data.xy.XYSeriesCollection", "org.jfree.data.xy.XYSeriesCollection", (String) null, arg3);
        String rangeDescription = timeSeries.getRangeDescription();
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals("org.jfree.data.xy.XYSeriesCollection", timeSeries.getDomainDescription());
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        assertNull(rangeDescription);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetRangeDescriptionReturningEmptyString() throws Throwable  {
        // Given a TimeSeries with default values
        Class<Day> arg3 = Day.class;
        TimeSeries timeSeries = new TimeSeries(",S5)YZ'<O*pA}A'GrV", "", "", arg3);
        
        // When the maximum item count, domain description and range description are requested
        Integer maxItemCount = timeSeries.getMaximumItemCount();
        String domainDescription = timeSeries.getDomainDescription();
        String rangeDescription = timeSeries.getRangeDescription();
        
        // Then the maximum item count is set to Integer.MAX_VALUE
        assertEquals(Integer.MAX_VALUE, maxItemCount);
        
        // And the domain and range descriptions are empty strings
        assertEquals("", domainDescription);
        assertEquals("", rangeDescription);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaximumItemAgeReturningZero() throws Throwable  {
        // Create a new TimeSeries with a large maximum item age
        TimeSeries timeSeries = new TimeSeries("{z=ZG3`e-");
        long expectedMaximumItemAge = 9223372036854775807L;
        
        // Assert that the expected maximum item age is returned
        assertEquals(expectedMaximumItemAge, timeSeries.getMaximumItemAge());
        
        // Set the maximum item age to 0
        timeSeries.setMaximumItemAge(0);
        
        // Assert that the maximum item age was set correctly
        assertEquals(0L, timeSeries.getMaximumItemAge());
        
        // Assert that the domain description is "Time"
        assertEquals("Time", timeSeries.getDomainDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDomainDescriptionReturningEmptyString() throws Throwable  {
        // Given: A TimeSeries object with a valid domain description
        Class<Object> arg1 = Object.class;
        TimeSeries timeSeries = new TimeSeries("yn=/{CjDydxAwp", arg1);
        
        // When: Setting the domain description to an empty string
        timeSeries.setDomainDescription("");
        
        // Then: The getDomainDescription() method should return an empty string
        assertEquals("", timeSeries.getDomainDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateCopyTaking2RegularTimePeriods() throws Throwable  {
        // Given: A TimeSeries object with a specific range and domain description
        TimeSeries timeSeries = new TimeSeries("");
        timeSeries.setNotify(false);
        
        // When: Creating a copy of the TimeSeries with a specific range and domain description
        Minute arg1 = new Minute();
        TimeSeries createCopy = timeSeries.createCopy((RegularTimePeriod) arg1, (RegularTimePeriod) arg1);
        
        // Then: The created TimeSeries should have the same maximum item count as the original
        assertEquals(Integer.MAX_VALUE, createCopy.getMaximumItemCount());
        
        // And: The created TimeSeries should have the same range description as the original
        assertEquals("Value", createCopy.getRangeDescription());
        
        // And: The created TimeSeries should have the same domain description as the original
        assertEquals("Time", createCopy.getDomainDescription());
        
        // And: The created TimeSeries should have the same maximum item age as the original
        assertEquals(9223372036854775807L, createCopy.getMaximumItemAge());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateCopyTaking2IntsReturningTimeSeriesWhereGetNotifyIsFalse() throws Throwable  {
        // Given a TimeSeries object with a maximum item count and age set to MAX_VALUE
        Class<Object> arg1 = Object.class;
        TimeSeries timeSeries = new TimeSeries("&]Z=F[deH@g+O* 8", arg1);
        timeSeries.setNotify(false);
        
        // When the createCopy method is called with a specified maximum item count and age
        TimeSeries createCopy = timeSeries.createCopy(2673, 2673);
        
        // Then the returned TimeSeries object has a maximum item count of Integer.MAX_VALUE
        assertEquals(Integer.MAX_VALUE, createCopy.getMaximumItemCount());
        
        // And the returned TimeSeries object has a maximum item age of Long.MAX_VALUE
        assertEquals(9223372036854775807L, createCopy.getMaximumItemAge());
        
        // And the returned TimeSeries object is not the same as the original time series
        assertNotSame(createCopy, timeSeries);
        
        // And the returned TimeSeries object has a range description of "Value"
        assertEquals("Value", createCopy.getRangeDescription());
        
        // And the returned TimeSeries object has a domain description of "Time"
        assertEquals("Time", createCopy.getDomainDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateCopyTaking2IntsReturningTimeSeriesWhereGetMaximumItemAgeIsPositive() throws Throwable  {
        // Given a TimeSeries with maximum item count of 0
        TimeSeries timeSeries = new TimeSeries("yn=/{CjDydxAwp");
        timeSeries.setMaximumItemCount(0);
        
        // When createCopy is called with start and end indices
        TimeSeries copy = timeSeries.createCopy(0, 2);
        
        // Then the resulting TimeSeries should be empty
        assertEquals(0, copy.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateCopyTaking2IntsThrowsIllegalArgumentException() throws Throwable  {
        // Arrange
        Class<Object> arg1 = Object.class;
        TimeSeries timeSeries = new TimeSeries("org.jfree.data.xy.XYSeries", arg1);
        
        // Act and Assert
        try {
        timeSeries.createCopy(273, (-2242));
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        // This test case is checking that the method throws an
        // IllegalArgumentException when start and end are in reverse order.
        verifyException("org.jfree.data.time.TimeSeries", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDeleteTaking2Arguments() throws Throwable  {
        // Given a TimeSeries instance with a specific domain and range descriptions
        TimeSeries timeSeries = new TimeSeries("`?++emF?wrETYa");
        
        // When we delete items from the series that are older than a specific age
        timeSeries.delete((-979), Integer.MAX_VALUE);
        
        // Then the domain description should be unchanged
        assertEquals("Time", timeSeries.getDomainDescription());
        
        // And the range description should be unchanged
        assertEquals("Value", timeSeries.getRangeDescription());
        
        // And the maximum item age should be updated to the specified value
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        
        // And the maximum item count should be unchanged
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDeleteTaking2ArgumentsThrowsIndexOutOfBoundsException() throws Throwable  {
        // Given: A time series with 0 elements
        TimeSeries ts = new TimeSeries(";");
        
        // When: We try to delete an element at index 1
        try {
        ts.delete(1, 1);
        fail("Expecting exception: IndexOutOfBoundsException");
        } catch(IndexOutOfBoundsException e) {
        // Then: The expected exception is thrown with the correct message and data
        assertEquals("java.util.ArrayList", e.getClass().getName());
        assertEquals("Index: 1, Size: 0", e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveAgedItemsTakingBoolean() throws Throwable  {
        // Given a TimeSeries with a large maximum item count and age
        TimeSeries timeSeries = new TimeSeries("|;");
        timeSeries.setMaximumItemCount(Integer.MAX_VALUE);
        timeSeries.setMaximumItemAge(9223372036854775807L);
        
        // When the aged items are removed
        timeSeries.removeAgedItems(false);
        
        // Then the maximum item count and age should not be changed
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddOrUpdateTaking1And1ReturningNonNull() throws Throwable  {
        // Given a Minute object representing the current time
        Minute currentMinute = new Minute();
        
        // When adding two data points to the TimeSeries with different values
        TimeSeries timeSeries = new TimeSeries("c(");
        timeSeries.addOrUpdate((RegularTimePeriod) currentMinute, (Number) 59);
        timeSeries.addOrUpdate((RegularTimePeriod) currentMinute, (Number) 0);
        
        // Then the TimeSeries should have a range description of "Value"
        assertEquals("Value", timeSeries.getRangeDescription());
        
        // And a domain description of "Time"
        assertEquals("Time", timeSeries.getDomainDescription());
        
        // And a maximum item age of 9223372036854775807L (Long.MAX_VALUE)
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        
        // And a maximum item count of Integer.MAX_VALUE
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIndex() throws Throwable  {
        // No Comments were added
        Class<JTable.PrintMode> arg1 = JTable.PrintMode.class;
        TimeSeries timeSeries = new TimeSeries("", arg1);
        Millisecond arg0 = new Millisecond();
        timeSeries.getIndex(arg0);
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals("Time", timeSeries.getDomainDescription());
        assertEquals("Value", timeSeries.getRangeDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIndexThrowsIllegalArgumentException() throws Throwable  {
        // Given: A TimeSeries object with a null period argument.
        TimeSeries timeSeries = new TimeSeries("Series ");
        
        try {
        // When: The getIndex method is called with a null period argument.
        timeSeries.getIndex((RegularTimePeriod) null);
        
        // Then: An IllegalArgumentException is thrown.
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the correct exception is thrown.
        verifyException("org.jfree.data.time.TimeSeries", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetItemCount() throws Throwable  {
        // Create a new TimeSeries object with an empty string as the series name
        TimeSeries ts = new TimeSeries("");
        
        // Check that the item count is equal to the maximum value of an integer
        assertEquals(Integer.MAX_VALUE, ts.getItemCount());
        
        // Check that the range description is equal to "Value"
        assertEquals("Value", ts.getRangeDescription());
        
        // Check that the maximum item age is equal to 9223372036854775807L
        assertEquals(9223372036854775807L, ts.getMaximumItemAge());
        
        // Check that the domain description is equal to "Time"
        assertEquals("Time", ts.getDomainDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCode() throws Throwable  {
        // Create a new TimeSeries object with default values for maximum item age and count.
        TimeSeries timeSeries = new TimeSeries("", (Class) null);
        
        // Test hashCode method of the TimeSeries class.
        int expectedHashCode = 0;
        assertEquals(expectedHashCode, timeSeries.hashCode());
        
        // Test getDomainDescription method of the TimeSeries class.
        String expectedDomainDescription = "Time";
        assertEquals(expectedDomainDescription, timeSeries.getDomainDescription());
        
        // Test getMaximumItemAge method of the TimeSeries class with a very large value.
        long maxItemAge = 9223372036854775807L;
        assertEquals(maxItemAge, timeSeries.getMaximumItemAge());
        
        // Test getMaximumItemCount method of the TimeSeries class with an integer value that is equal to Integer.MAX_VALUE.
        int maxItemCount = Integer.MAX_VALUE;
        assertEquals(maxItemCount, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetMaximumItemCountWithPositive() throws Throwable  {
        // Create a new TimeSeries object with the given data
        TimeSeries ts = new TimeSeries("2s[mO>");
        
        // Set the maximum item count of the TimeSeries to 3160
        ts.setMaximumItemCount(3160);
        
        // Create a copy of the TimeSeries object
        TimeSeries arg0 = new TimeSeries("2s[mO>");
        
        // Check if the two TimeSeries objects are equal
        boolean equals = ts.equals(arg0);
        
        // Assert that the maximum item count of the original TimeSeries is 3160
        assertEquals(3160, ts.getMaximumItemCount());
        
        // Assert that the two TimeSeries objects are not equal
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetMaximumItemAgeWithPositive() throws Throwable  {
        // Create two TimeSeries objects with different maximum item ages
        TimeSeries arg0 = new TimeSeries("org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset");
        arg0.setMaximumItemAge(25316L);
        TimeSeries timeSeries = new TimeSeries("org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset");
        
        // Check that the two objects are not equal
        assertFalse(timeSeries.equals(arg0));
        
        // Set the maximum item age of the first object to match the second object's value
        arg0.setMaximumItemAge(25316L);
        
        // Check that the two objects are now equal
        assertTrue(timeSeries.equals(arg0));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetRangeDescriptionWithNonEmptyString() throws Throwable  {
        // Set up a TimeSeries with a range description
        TimeSeries arg0 = new TimeSeries("/mHVgwNl}g}9");
        arg0.setRangeDescription("/mHVgwNl}g}9");
        
        // Create another TimeSeries with the same range description as arg0
        TimeSeries timeSeries = new TimeSeries("/mHVgwNl}g}9");
        timeSeries.setRangeDescription("/mHVgwNl}g}9");
        
        // Assert that these two instances are equal, even though they have different underlying data structures
        assertTrue(arg0.equals(timeSeries));
        
        // Assert that the range description is set correctly on both instances
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetDomainDescriptionWithNonEmptyString() throws Throwable  {
        // Given two TimeSeries objects with different domain descriptions
        TimeSeries timeSeries = new TimeSeries("`");
        TimeSeries arg0 = new TimeSeries("`");
        arg0.setDomainDescription("`");
        
        // When we compare the TimeSeries objects using the equals method
        boolean equals = timeSeries.equals(arg0);
        
        // Then we expect the two objects to be unequal
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesTimeSeriesTaking4Arguments() throws Throwable  {
        // Given
        TimeSeries arg0 = new TimeSeries("f%anLSRSxf+el)");
        Class<InputStream> arg3 = InputStream.class;
        TimeSeries timeSeries = new TimeSeries("", "", "XpuBm`P", arg3);
        
        // When
        boolean equals = timeSeries.equals(arg0);
        
        // Then
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningTrue() throws Throwable  {
        // Given a TimeSeries object with some pre-defined data
        TimeSeries series = new TimeSeries("yn=/{CjDydxAwp");
        
        // When the equals method is called with the same TimeSeries object
        boolean result = series.equals(series);
        
        // Then the equals method should return true
        assertTrue(result);
        
        // And the maximum item count of the TimeSeries should be Integer.MAX_VALUE
        assertEquals(Integer.MAX_VALUE, series.getMaximumItemCount());
        
        // And the range description of the TimeSeries should be "Value"
        assertEquals("Value", series.getRangeDescription());
        
        // And the domain description of the TimeSeries should be "Time"
        assertEquals("Time", series.getDomainDescription());
        
        // And the maximum item age of the TimeSeries should be 9223372036854775807L
        assertEquals(9223372036854775807L, series.getMaximumItemAge());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEquals() throws Throwable  {
        // Test that the TimeSeries class can handle basic string values correctly
        TimeSeries timeSeries = new TimeSeries("!");
        boolean equals = timeSeries.equals("!");
        assertFalse(equals); // Verify that the TimeSeries does not equal the string "!"
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount()); // Verify that the maximum item count is set to Integer.MAX_VALUE
        assertEquals("Time", timeSeries.getDomainDescription()); // Verify that the domain description is set to "Time"
        assertEquals("Value", timeSeries.getRangeDescription()); // Verify that the range description is set to "Value"
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge()); // Verify that the maximum item age is set to 9223372036854775807L
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateCopyTaking2RegularTimePeriodsWithNonNull() throws Throwable  {
        // Given a TimeSeries containing a single FixedMillisecond object
        TimeSeries timeSeries = new TimeSeries("java.ang.Class");
        FixedMillisecond arg0 = new FixedMillisecond();
        timeSeries.addOrUpdate((RegularTimePeriod) arg0, (Number) null);
        
        // When the previous() method is called on the FixedMillisecond object
        RegularTimePeriod previousTimePeriod = arg0.previous();
        
        // Then a new TimeSeries containing the previous time period should be created
        TimeSeries createCopy = timeSeries.createCopy(previousTimePeriod, previousTimePeriod);
        
        // And the new TimeSeries should have the same domain and range descriptions as the original TimeSeries
        assertEquals("Time", createCopy.getDomainDescription());
        assertEquals(9223372036854775807L, createCopy.getMaximumItemAge());
        assertEquals(Integer.MAX_VALUE, createCopy.getMaximumItemCount());
        assertEquals("Value", createCopy.getRangeDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTaking1And1() throws Throwable  {
        // No Comments were added
        Minute minute = new Minute();
        MockDate arg0 = new MockDate(59, 59, 0, 0, 59, 59);
        Day arg1 = new Day(arg0, minute.DEFAULT_TIME_ZONE);
        TimeSeries timeSeries = new TimeSeries("G?NqfWhh*$z8");
        timeSeries.add((RegularTimePeriod) arg1, (Number) 59);
        timeSeries.createCopy((RegularTimePeriod) arg1, (RegularTimePeriod) arg1);
        assertEquals(1, timeSeries.getItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateCopyTaking2RegularTimePeriodsWithNull() throws Throwable  {
        // Tests the method createCopy(RegularTimePeriod start, RegularTimePeriod end) with a null 'start' argument.
        TimeSeries timeSeries = new TimeSeries("'8E#e)KE+ayaETY");
        try {
        timeSeries.createCopy((RegularTimePeriod) null, (RegularTimePeriod) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the correct exception is thrown when a null 'start' argument is passed to createCopy().
        verifyException("org.jfree.data.time.TimeSeries", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateCopyTaking2RegularTimePeriodsThrowsIllegalArgumentException() throws Throwable  {
        Minute minute = new Minute();
        TimeSeries timeSeries = new TimeSeries("x^$62GyyEKYnV");
        // Test that createCopy() throws an exception with a null 'end' argument.
        try {
        timeSeries.createCopy(minute, null);
        fail("Expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify the expected exception was thrown.
        verifyException("org.jfree.data.time.TimeSeries", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreateCopyTaking2IntsWithNegative() throws Throwable  {
        // No Comments were added
        TimeSeries timeSeries = new TimeSeries("");
        // Undeclared exception!
        try { 
          timeSeries.createCopy((-5149), (-5149));
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Requires start >= 0.
           //
           verifyException("org.jfree.data.time.TimeSeries", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDeleteTaking2ArgumentsThrowsIllegalArgumentException() throws Throwable  {
        // rollbacked to evosuite
        TimeSeries timeSeries = new TimeSeries("`?++emF?wrETYa");
        // Undeclared exception!
        try { 
          timeSeries.delete((-979), (-2147483639));
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Requires start <= end.
           //
           verifyException("org.jfree.data.time.TimeSeries", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddOrUpdateTaking1And1AndDeleteTakingRegularTimePeriod() throws Throwable  {
        // Given a TimeSeries with a single item
        TimeSeries timeSeries = new TimeSeries("yn=/{CjDydxAwp");
        Minute arg0 = new Minute();
        timeSeries.addOrUpdate((RegularTimePeriod) arg0, (Number) 59);
        
        // When we delete the item
        timeSeries.delete((RegularTimePeriod) arg0);
        
        // Then the item count should be zero
        assertEquals(0, timeSeries.getItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDeleteTakingRegularTimePeriod() throws Throwable  {
        // Given a TimeSeries object with default values
        TimeSeries timeSeries = new TimeSeries(":");
        
        // When we call the delete method with a RegularTimePeriod argument
        Week arg0 = new Week();
        timeSeries.delete((RegularTimePeriod) arg0);
        
        // Then the domain description should be "Time" and the maximum item age should be Long.MAX_VALUE
        assertEquals("Time", timeSeries.getDomainDescription());
        assertEquals(Long.MAX_VALUE, timeSeries.getMaximumItemAge());
        
        // And the maximum item count should be Integer.MAX_VALUE
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddOrUpdateTaking1And1AndClear() throws Throwable  {
        // Given a TimeSeries object with a valid start and end date
        TimeSeries timeSeries = new TimeSeries("Requires start <= end.");
        
        // When we add or update an item to the TimeSeries using a RegularTimePeriod as key
        Second arg0 = new Second();
        timeSeries.addOrUpdate((RegularTimePeriod) arg0, (Number) 0);
        
        // And then clear all items from the TimeSeries
        timeSeries.clear();
        
        // Then we should get the expected item count of zero
        assertEquals(0, timeSeries.getItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClear() throws Throwable  {
        // Setup
        TimeSeries timeSeries = new TimeSeries("JpRK4`$M&j*x{'e");
        
        // Execute
        timeSeries.clear();
        
        // Verify
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals("Value", timeSeries.getRangeDescription());
        assertEquals("Time", timeSeries.getDomainDescription());
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRemoveAgedItemsTaking2Arguments() throws Throwable  {
        // Given
        TimeSeries timeSeries = new TimeSeries("");
        
        // When
        timeSeries.removeAgedItems(-2072L, false);
        
        // Then
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals("Value", timeSeries.getRangeDescription());
        assertEquals("Time", timeSeries.getDomainDescription());
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesTimeSeriesTaking2ArgumentsAndCallsSetMaximumItemCount() throws Throwable  {
        // Given a TimeSeries with some items
        Minute minute = new Minute();
        Class<Object> clazz = Object.class;
        TimeSeries timeSeries = new TimeSeries("yn=/{CjDydxAwp", clazz);
        timeSeries.addOrUpdate(minute, 59);
        
        // When the maximum item count is set to zero
        timeSeries.setMaximumItemCount(0);
        
        // Then the maximum item count should be zero
        assertEquals(0, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddOrUpdateTaking1And1ThrowsIllegalArgumentException() throws Throwable  {
        // Given
        TimeSeries timeSeries = new TimeSeries("Time");
        
        // When
        try {
        timeSeries.addOrUpdate((RegularTimePeriod) null, (Number) null);
        } catch (IllegalArgumentException e) {
        // Then
        assertEquals("Null 'period' argument.", e.getMessage());
        throw e;}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testUpdateThrowsRuntimeException() throws Throwable  {
        // Given
        TimeSeries timeSeries = new TimeSeries("");
        Hour hourArg0 = new Hour();
        
        // When
        try {
        timeSeries.update((RegularTimePeriod) hourArg0, (Number) 0);
        } catch(RuntimeException e) {
        throw new RuntimeException("TimeSeries.update(TimePeriod, Number):  period does not exist.");}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTaking1And1ThrowsIllegalArgumentException() throws Throwable  {
        TimeSeries timeSeries = new TimeSeries("Index outside valid range.");
        // Undeclared exception!
        try {
        timeSeries.add((TimeSeriesDataItem) null, false);
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        //
        // Null 'item' argument.
        //
        verifyException("org.jfree.data.time.TimeSeries", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetValueTakingRegularTimePeriodReturningNumberWhereByteValueIsZero() throws Throwable  {
        // rollbacked to evosuite
        Day arg0 = new Day();
        TimeSeries timeSeries = new TimeSeries("Time");
        BigInteger arg1 = BigInteger.ZERO;
        TimeSeriesDataItem addOrUpdate = timeSeries.addOrUpdate((RegularTimePeriod) arg0, (Number) arg1);
        assertNull(addOrUpdate);
        
        Number value = timeSeries.getValue((RegularTimePeriod) arg0);
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertNotNull(value);
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        assertEquals("Value", timeSeries.getRangeDescription());
        assertEquals("Time", timeSeries.getDomainDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetValueTakingRegularTimePeriodReturningNull() throws Throwable  {
        // Given a FixedMillisecond object as an argument
        FixedMillisecond arg0 = new FixedMillisecond();
        
        // When we call getValue on a TimeSeries object with this argument
        TimeSeries timeSeries = new TimeSeries("&s2vVGTceN|LQgxE");
        timeSeries.getValue((RegularTimePeriod) arg0);
        
        // Then the maximum item age should be 9223372036854775807L
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        
        // And the domain description should be "Time"
        assertEquals("Time", timeSeries.getDomainDescription());
        
        // And the range description should be "Value"
        assertEquals("Value", timeSeries.getRangeDescription());
        
        // And the maximum item count should be Integer.MAX_VALUE
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDataItemThrowsIllegalArgumentException() throws Throwable  {
        TimeSeries timeSeries = new TimeSeries("org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset");
        // Undeclared exception!
        try {
        timeSeries.getDataItem(null);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        //
        // Null 'period' argument
        //
        verifyException("org.jfree.data.time.TimeSeries", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDataItem() throws Throwable  {
        // rollbacked to evosuite
        FixedMillisecond arg0 = new FixedMillisecond();
        TimeSeries timeSeries = new TimeSeries("org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset");
        timeSeries.getDataItem((RegularTimePeriod) arg0);
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        assertEquals("Time", timeSeries.getDomainDescription());
        assertEquals("Value", timeSeries.getRangeDescription());
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetMaximumItemAgeThrowsIllegalArgumentException() throws Throwable  {
        // No Comments were added
        TimeSeries timeSeries = new TimeSeries("Fm_jV]~sA|V-\"GY ");
        // Undeclared exception!
        try { 
          timeSeries.setMaximumItemAge((-4749L));
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Negative 'periods' argument.
           //
           verifyException("org.jfree.data.time.TimeSeries", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetMaximumItemAge() throws Throwable  {
        // Create a new TimeSeries with a maximum item age of 9223372036854775807L
        TimeSeries timeSeries = new TimeSeries("G?NqfWhh*$z8");
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        
        // Set the maximum item age to 0 and create a copy of the TimeSeries with a maximum item count of 0
        timeSeries.setMaximumItemAge(0);
        timeSeries.createCopy(0, 0);
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetMaximumItemCountThrowsIllegalArgumentException() throws Throwable  {
        // Given
        TimeSeries timeSeries = new TimeSeries("F@");
        
        try {
        // When
        timeSeries.setMaximumItemCount(-1);
        
        // Then
        fail("Expecting exception: IllegalArgumentException");
        
        } catch (IllegalArgumentException e) {
        // Negative 'maximum' argument.
        verifyException("org.jfree.data.time.TimeSeries", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaximumItemCountReturningZero() throws Throwable  {
        // Given a TimeSeries object with some initial data
        TimeSeries timeSeries = new TimeSeries("n_m6'7");
        
        // When the maximum item count is set to 0
        timeSeries.setMaximumItemCount(0);
        
        // Then the getMaximumItemCount method should return 0
        int actualMaximumItemCount = timeSeries.getMaximumItemCount();
        assertEquals(0, actualMaximumItemCount);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetRangeDescriptionReturningNonEmptyString() throws Throwable  {
        // Create a new TimeSeries object with some sample data
        TimeSeries timeSeries = new TimeSeries("*T9}I.x5J@xzK{_");
        
        // Verify that the rangeDescription is correct
        assertEquals("Value", timeSeries.getRangeDescription());
        
        // Verify that the maximumItemCount is set to the maximum value
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        
        // Verify that the domainDescription is set to "Time"
        assertEquals("Time", timeSeries.getDomainDescription());
        
        // Verify that the maximumItemAge is set to the maximum value
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaximumItemAgeReturningPositive() throws Throwable  {
        // No Comments were added
        TimeSeries timeSeries = new TimeSeries("Fm_jV]~sA|V-\"GY ");
        long maximumItemAge = timeSeries.getMaximumItemAge();
        assertEquals("Value", timeSeries.getRangeDescription());
        assertEquals("Time", timeSeries.getDomainDescription());
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals(9223372036854775807L, maximumItemAge);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetRangeDescriptionWithNull() throws Throwable  {
        // No Comments were added
        TimeSeries timeSeries = new TimeSeries("org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset");
        assertEquals("Value", timeSeries.getRangeDescription());
        
        timeSeries.setRangeDescription((String) null);
        timeSeries.hashCode();
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        assertEquals("Time", timeSeries.getDomainDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTaking3ArgumentsThrowsIllegalArgumentException() throws Throwable  {
        // Test the exception is thrown when adding a null period to a TimeSeries
        Class<XYDatasetTableModel> arg1 = XYDatasetTableModel.class;
        TimeSeries timeSeries = new TimeSeries("^Fe8xpF8", arg1);
        try {
        timeSeries.add((RegularTimePeriod) null, 4608.525, true);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the correct exception is thrown
        verifyException("org.jfree.data.time.TimeSeriesDataItem", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetValueTakingIntThrowsArrayIndexOutOfBoundsException() throws Throwable  {
        // No Comments were added
        TimeSeries timeSeries = new TimeSeries("");
        // Undeclared exception!
        try { 
          timeSeries.getValue((-2211));
          fail("Expecting exception: ArrayIndexOutOfBoundsException");
        
        } catch(ArrayIndexOutOfBoundsException e) {
           //
           // no message in exception (getMessage() returned null)
           //
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNextTimePeriodThrowsArrayIndexOutOfBoundsException() throws Throwable  {
        // Arrange
        Class<Day> arg1 = Day.class;
        TimeSeries timeSeries = new TimeSeries("+`pao.BL4T617bX3v)V", arg1);
        
        // Act
        try {
        timeSeries.getNextTimePeriod();
        } catch (ArrayIndexOutOfBoundsException e) {
        // Assert
        assertEquals(null, e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetTimePeriodClassReturningClassWhereIsEnumIsFalse() throws Throwable  {
        // Given
        Class<ChronoLocalDate> arg1 = ChronoLocalDate.class;
        TimeSeries timeSeries = new TimeSeries("", arg1);
        
        // When
        Class<?> actual = timeSeries.getTimePeriodClass();
        
        // Then
        assertEquals(arg1, actual);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetItems() throws Throwable  {
        // rollbacked to evosuite
        TimeSeries timeSeries = new TimeSeries("org.jfree.data.general.DefaultKeyedValues2DDataset");
        timeSeries.getItems();
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals("Time", timeSeries.getDomainDescription());
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        assertEquals("Value", timeSeries.getRangeDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddOrUpdateTaking1And1() throws Throwable  {
        // No Comments were added
        Class<Day> arg1 = Day.class;
        TimeSeries timeSeries = new TimeSeries("+`pao.BL4T617bX3v)V", arg1);
        Quarter arg0 = new Quarter();
        timeSeries.addOrUpdate((RegularTimePeriod) arg0, (double) 4);
        assertEquals(1, timeSeries.getItemCount());
        
        timeSeries.getNextTimePeriod();
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMaximumItemCountReturningPositive() throws Throwable  {
        // Set up a new TimeSeries instance
        TimeSeries timeSeries = new TimeSeries("");
        
        // Get the maximum item count for the TimeSeries
        int maximumItemCount = timeSeries.getMaximumItemCount();
        
        // Assert that the value returned by getRangeDescription() is "Value"
        assertEquals("Value", timeSeries.getRangeDescription());
        
        // Assert that the maximum item count is equal to Integer.MAX_VALUE
        assertEquals(Integer.MAX_VALUE, maximumItemCount);
        
        // Assert that the maximum item age is equal to 9223372036854775807L (Long.MAX_VALUE)
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        
        // Assert that the domain description for the TimeSeries is "Time"
        assertEquals("Time", timeSeries.getDomainDescription());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetDomainDescriptionWithNull() throws Throwable  {
        // No Comments were added
        TimeSeries timeSeries = new TimeSeries("JpRK4`$M&j*x{'e");
        assertEquals("Time", timeSeries.getDomainDescription());
        
        timeSeries.setDomainDescription((String) null);
        timeSeries.hashCode();
        assertEquals("Value", timeSeries.getRangeDescription());
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDomainDescriptionReturningNonEmptyString() throws Throwable  {
        // Arrange
        TimeSeries timeSeries = new TimeSeries("Y");
        
        // Act
        String domainDescription = timeSeries.getDomainDescription();
        assertEquals("Value", timeSeries.getRangeDescription());
        assertEquals(Integer.MAX_VALUE, timeSeries.getMaximumItemCount());
        assertEquals(9223372036854775807L, timeSeries.getMaximumItemAge());
        
        // Assert
        assertEquals("Time", domainDescription);
    }
  }
  