content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 20:17:34 GMT 2024
   */
  
  package org.jfree.chart.plot;
  
  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.awt.Color;
  import java.awt.Paint;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.jfree.chart.JFreeChart;
  import org.jfree.chart.LegendItemCollection;
  import org.jfree.chart.plot.MultiplePiePlot;
  import org.jfree.data.category.CategoryDataset;
  import org.jfree.data.category.DefaultCategoryDataset;
  import org.jfree.data.category.DefaultIntervalCategoryDataset;
  import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset;
  import org.jfree.util.TableOrder;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class MultiplePiePlot_ESTest extends MultiplePiePlot_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetPieChart() throws Throwable  {
        // No Comments were added
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot((CategoryDataset) null);
        multiplePiePlot.setPieChart((JFreeChart) null);
        multiplePiePlot.getPieChart();
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLimitReturningPositive() throws Throwable  {
        // Given
        MultiplePiePlot plot = new MultiplePiePlot();
        
        // When
        plot.setLimit(3047.485829937);
        double limit = plot.getLimit();
        
        // Then
        assertEquals(3047.485829937, limit, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLimitReturningNegative() throws Throwable  {
        // Test that the default limit is 0.0
        DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset();
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot(dataset);
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
        
        // Test that the limit can be set to a negative value
        multiplePiePlot.setLimit(-1.0);
        double limit = multiplePiePlot.getLimit();
        assertEquals(-1.0, limit, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLegendItemsReturningLegendItemCollectionWhereGetItemCountIsZero() throws Throwable  {
        // rollbacked to evosuite
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        multiplePiePlot.getLegendItems();
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLegendItems() throws Throwable  {
        // Create a dataset with 7 rows and 9 columns
        Number[][] data = new Number[7][9];
        DefaultIntervalCategoryDataset dataset = new DefaultIntervalCategoryDataset(data, data);
        
        // Create a MultiplePiePlot with the dataset
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot(dataset);
        
        // Get the legend items from the MultiplePiePlot
        LegendItemCollection legendItems = multiplePiePlot.getLegendItems();
        
        // Assert that there are 7 legend items in total
        assertEquals(7, legendItems.getItemCount());
        
        // Assert that the limit of the MultiplePiePlot is 0.0 with a tolerance of 0.01
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMultiplePiePlotTakingNoArgumentsAndEqualsAndEqualsReturningFalse() throws Throwable  {
        // Create a new instance of MultiplePiePlot and set its background image alignment
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        multiplePiePlot.setBackgroundImageAlignment(2244);
        
        // Create another instance of MultiplePiePlot and verify that it is equal to the first instance
        MultiplePiePlot arg0 = new MultiplePiePlot();
        assertTrue(multiplePiePlot.equals((Object)arg0));
        
        // Modify the background image alignment of the second instance and verify that it is no longer equal to the first instance
        multiplePiePlot.setBackgroundImageAlignment(2244);
        boolean equals = multiplePiePlot.equals(arg0);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetAggregatedItemsKey() throws Throwable  {
        // rollbacked to evosuite
        MultiplePiePlot arg0 = new MultiplePiePlot();
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        assertTrue(multiplePiePlot.equals((Object)arg0));
        
        multiplePiePlot.setAggregatedItemsKey(1.0F);
        boolean equals = multiplePiePlot.equals(arg0);
        assertFalse(multiplePiePlot.equals((Object)arg0));
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEquals() throws Throwable  {
        // Create a new instance of the MultiplePiePlot class with default values
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        
        // Clone the original instance and set a new limit on the clone
        MultiplePiePlot arg0 = (MultiplePiePlot)multiplePiePlot.clone();
        arg0.setLimit(10);
        
        // Test that the cloned instance has the correct limit value
        assertEquals(10.0, arg0.getLimit(), 0.01);
        
        // Test that the original instance and the cloned instance are not equal
        boolean equals = multiplePiePlot.equals(arg0);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMultiplePiePlotTakingNoArgumentsAndCallsEquals0() throws Throwable  {
        // Given: A MultiplePiePlot instance with a specific limit value
        MultiplePiePlot plot = new MultiplePiePlot();
        plot.setLimit(0.5);
        
        // When: The plot is cloned and the equality method is called on the original and the clone
        MultiplePiePlot arg0 = (MultiplePiePlot) plot.clone();
        boolean equals = plot.equals(arg0);
        
        // Then: The two plots are equal, and the limit value has been preserved in the clone
        assertTrue(equals);
        assertEquals(0.5, arg0.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMultiplePiePlotTakingNoArgumentsAndCallsEquals1() throws Throwable  {
        // No Comments were added
        MultiplePiePlot arg0 = new MultiplePiePlot();
        boolean equals = arg0.equals(arg0);
        assertTrue(equals);
        assertEquals(0.0, arg0.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsWithNull() throws Throwable  {
        // rollbacked to evosuite
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot((CategoryDataset) null);
        boolean equals = multiplePiePlot.equals((Object) null);
        assertFalse(equals);
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMultiplePiePlotTakingCategoryDatasetAndCallsSetLimit() throws Throwable  {
        // Create a new instance of JFreeChart with a DefaultIntervalCategoryDataset and MultiplePiePlot
        Number[][] arg2 = new Number[1][8];
        Number[] numberArray = new Number[14];
        numberArray[0] = (Number) 1.0F;
        arg2[0] = numberArray;
        DefaultIntervalCategoryDataset arg0 = new DefaultIntervalCategoryDataset((String[]) null, arg2, arg2);
        MultiplePiePlot arg1 = new MultiplePiePlot(arg0);
        JFreeChart jFreeChart = new JFreeChart("", arg1);
        
        // Set the limit on the MultiplePiePlot
        arg1.setLimit(2489.03125);
        
        // Assert that the limit has been set correctly
        assertEquals(2489.03125, arg1.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMultiplePiePlotTakingCategoryDataset() throws Throwable  {
        // Create a dataset with 13 rows and 8 columns
        Number[][] arg2 = new Number[13][8];
        // Populate the first row of the dataset with two values
        Number[] numberArray = new Number[2];
        numberArray[0] = (Number) 1.0F;
        arg2[0] = numberArray;
        // Create a DefaultIntervalCategoryDataset from the dataset
        DefaultIntervalCategoryDataset dataSet = new DefaultIntervalCategoryDataset((String[]) null, arg2, arg2);
        // Create a MultiplePiePlot using the dataset
        MultiplePiePlot plot = new MultiplePiePlot(dataSet);
        // Create a JFreeChart with the plot and a title
        JFreeChart jFreeChart = new JFreeChart("", plot);
        // Get the limit of the plot (the maximum value in the dataset)
        double limit = plot.getLimit();
        // Assert that the limit is equal to 1.0 within a tolerance of 0.01
        assertEquals(1.0, limit, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetAggregatedItemsPaintThrowsIllegalArgumentException() throws Throwable  {
        // Test that setAggregatedItemsPaint() throws an IllegalArgumentException
        // when passed a null 'paint' argument.
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        try {
        multiplePiePlot.setAggregatedItemsPaint(null);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the expected exception was thrown.
        verifyException("org.jfree.chart.plot.MultiplePiePlot", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetAggregatedItemsKeyThrowsIllegalArgumentException() throws Throwable  {
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        try {
        multiplePiePlot.setAggregatedItemsKey(null); // Undeclared exception!
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // The null 'key' argument.
        verifyException("org.jfree.chart.plot.MultiplePiePlot", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetDataExtractOrderThrowsIllegalArgumentException() throws Throwable  {
        // No Comments were added
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        // Undeclared exception!
        try { 
          multiplePiePlot.setDataExtractOrder((TableOrder) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Null 'order' argument
           //
           verifyException("org.jfree.chart.plot.MultiplePiePlot", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetDatasetWithNonNull() throws Throwable  {
        // Given a dataset and a MultiplePiePlot instance
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        MultiplePiePlot plot = new MultiplePiePlot(dataset);
        
        // When the limit of the plot is set to 0.0
        plot.setLimit(0.0);
        
        // Then the getLimit method should return 0.0 with a tolerance of 0.01
        assertEquals(0.0, plot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetDatasetWithNull() throws Throwable  {
        // Given a MultiplePiePlot instance with a null dataset
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot((CategoryDataset) null);
        
        // When the limit is set to 0.0
        multiplePiePlot.setLimit(0.0);
        
        // Then the expected value of the limit is 0.0 with a tolerance of 0.01
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLimitReturningZero() throws Throwable  {
        // Given a MultiplePiePlot object with a set limit of 0.0
        MultiplePiePlot plot = new MultiplePiePlot();
        plot.setLimit(0.0);
        
        // When the getLimit method is called on this plot
        double actualLimit = plot.getLimit();
        
        // Then the expected limit of 0.0 should be returned
        assertEquals(0.0, actualLimit, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDataset() throws Throwable  {
        // rollbacked to evosuite
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        multiplePiePlot.getDataset();
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetAggregatedItemsKey() throws Throwable  {
        // Create a new multiple pie plot with null data set
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot((CategoryDataset) null);
        
        // Assert that the aggregated items key is "Other"
        assertEquals("Other", multiplePiePlot.getAggregatedItemsKey());
        
        // Assert that the limit is 0.0 with a precision of 0.01
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetAggregatedItemsPaint() throws Throwable  {
        // No Comments were added
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot((CategoryDataset) null);
        Color aggregatedItemsPaint = (Color)multiplePiePlot.getAggregatedItemsPaint();
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
        assertEquals((-4144960), aggregatedItemsPaint.getRGB());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDataExtractOrder() throws Throwable  {
        // rollbacked to evosuite
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot((CategoryDataset) null);
        multiplePiePlot.getDataExtractOrder();
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPlotType() throws Throwable  {
        // Given a MultiplePiePlot instance with some default values
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot();
        
        // When the plot type is requested
        String plotType = multiplePiePlot.getPlotType();
        
        // Then the plot type should be "Multiple Pie Plot"
        assertEquals("Multiple Pie Plot", plotType);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPieChartReturningJFreeChartWhereIsNotifyIsTrue() throws Throwable  {
        // rollbacked to evosuite
        MultiplePiePlot multiplePiePlot = new MultiplePiePlot((CategoryDataset) null);
        multiplePiePlot.getPieChart();
        assertEquals(0.0, multiplePiePlot.getLimit(), 0.01);
    }
  }
  