content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Wed Mar 20 04:18:27 GMT 2024
   */
  
  package org.jfree.chart.renderer.category;
  
  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.Graphics2D;
  import java.awt.Paint;
  import java.awt.Polygon;
  import java.awt.Rectangle;
  import java.awt.geom.Rectangle2D;
  import javax.swing.JTable;
  import javax.swing.text.DefaultCaret;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.jfree.chart.axis.CategoryAxis;
  import org.jfree.chart.axis.CategoryAxis3D;
  import org.jfree.chart.axis.DateAxis;
  import org.jfree.chart.axis.PeriodAxis;
  import org.jfree.chart.plot.CombinedDomainCategoryPlot;
  import org.jfree.chart.plot.CombinedRangeCategoryPlot;
  import org.jfree.chart.plot.PlotRenderingInfo;
  import org.jfree.chart.renderer.category.CategoryItemRendererState;
  import org.jfree.chart.renderer.category.StatisticalBarRenderer;
  import org.jfree.data.category.CategoryDataset;
  import org.jfree.data.statistics.DefaultStatisticalCategoryDataset;
  import org.jfree.data.statistics.StatisticalCategoryDataset;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class StatisticalBarRenderer_ESTest extends StatisticalBarRenderer_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDrawVerticalItemThrowsNullPointerException() throws Throwable  {
        // No Comments were added
        StatisticalBarRenderer statisticalBarRenderer = new StatisticalBarRenderer();
        CategoryItemRendererState arg1 = new CategoryItemRendererState((PlotRenderingInfo) null);
        Polygon polygon = new Polygon();
        Rectangle2D arg2 = polygon.getBounds2D();
        PeriodAxis arg5 = new PeriodAxis("ql!k0;Vw7d9$");
        CombinedDomainCategoryPlot arg3 = new CombinedDomainCategoryPlot();
        CategoryAxis arg4 = new CategoryAxis("ql!k0;Vw7d9$");
        // Undeclared exception!
        try { 
          statisticalBarRenderer.drawVerticalItem((Graphics2D) null, arg1, arg2, arg3, arg4, arg5, (StatisticalCategoryDataset) null, (-873), (-873));
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("org.jfree.chart.renderer.category.StatisticalBarRenderer", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetErrorIndicatorPaint() throws Throwable  {
        // Given a statistical bar renderer
        StatisticalBarRenderer statisticalBarRenderer = new StatisticalBarRenderer();
        
        // When the renderer is cloned
        Object arg0 = statisticalBarRenderer.clone();
        
        // Then the clone should be equal to the original renderer
        assertTrue(arg0.equals((Object) statisticalBarRenderer));
        
        // And setting the error indicator paint to null should not affect the equality
        statisticalBarRenderer.setErrorIndicatorPaint((Paint) null);
        boolean equals = statisticalBarRenderer.equals(arg0);
        assertFalse(arg0.equals((Object) statisticalBarRenderer));
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningFalse0() throws Throwable  {
        // No Comments were added
        StatisticalBarRenderer arg0 = new StatisticalBarRenderer();
        StatisticalBarRenderer statisticalBarRenderer = new StatisticalBarRenderer();
        assertTrue(statisticalBarRenderer.equals((Object)arg0));
        
        statisticalBarRenderer.setFillPaint(arg0.DEFAULT_OUTLINE_PAINT);
        boolean equals = statisticalBarRenderer.equals(arg0);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningFalse1() throws Throwable  {
        // Given
        StatisticalBarRenderer statisticalBarRenderer = new StatisticalBarRenderer();
        
        // When
        boolean equals = statisticalBarRenderer.equals("Hello, world!");
        
        // Then
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningTrue0() throws Throwable  {
        // Given a statistical bar renderer object, arg0
        StatisticalBarRenderer arg0 = new StatisticalBarRenderer();
        
        // When the equals method is called with itself as an argument
        boolean equals = arg0.equals(arg0);
        
        // Then it should return true
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningTrue1() throws Throwable  {
        // Create a new instance of StatisticalBarRenderer
        StatisticalBarRenderer statisticalBarRenderer = new StatisticalBarRenderer();
        
        // Clone the instance
        Object arg0 = statisticalBarRenderer.clone();
        
        // Test that the clone is equal to the original instance
        boolean equals = statisticalBarRenderer.equals(arg0);
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDrawItemThrowsIllegalArgumentException() throws Throwable  {
        // Create a new StatisticalBarRenderer object.
        StatisticalBarRenderer renderer = new StatisticalBarRenderer();
        
        // Create a new JTable with 1291 rows and 37 columns.
        JTable table = new JTable(1291, 37);
        
        // Get the bounds of the table.
        Rectangle rect = table.getBounds();
        
        // Create a new CombinedRangeCategoryPlot object.
        CombinedRangeCategoryPlot plot = new CombinedRangeCategoryPlot();
        
        // Create a new CategoryAxis object with no label.
        CategoryAxis xAxis = new CategoryAxis("");
        
        // Create a new PeriodAxis object with no label.
        PeriodAxis yAxis = new PeriodAxis("");
        
        try {
        // Call the drawItem() method with null Graphics2D and null CategoryItemRendererState objects.
        renderer.drawItem((Graphics2D) null, (CategoryItemRendererState) null, rect, plot, xAxis, yAxis, (CategoryDataset) null, 1, 0, 0);
        
        // Fail the test with an IllegalArgumentException if the drawItem() method did not throw an exception.
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the expected exception was thrown.
        verifyException("org.jfree.chart.renderer.category.StatisticalBarRenderer", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDrawItemThrowsNullPointerException() throws Throwable  {
        // Given
        DefaultCaret caret = new DefaultCaret();
        CombinedRangeCategoryPlot plot = new CombinedRangeCategoryPlot();
        StatisticalBarRenderer renderer = new StatisticalBarRenderer();
        DateAxis xAxis = new DateAxis();
        CategoryAxis3D yAxis = new CategoryAxis3D();
        DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset();
        
        // When
        try {
        renderer.drawItem((Graphics2D) null, (CategoryItemRendererState) null, caret, plot, yAxis, xAxis, dataset, 0, 0, 0);
        fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        // no message in exception (getMessage() returned null)
        verifyException("org.jfree.chart.renderer.category.StatisticalBarRenderer", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetErrorIndicatorPaintReturningNull() throws Throwable  {
        // Create an instance of StatisticalBarRenderer
        StatisticalBarRenderer statisticalBarRenderer = new StatisticalBarRenderer();
        
        // Set the error indicator paint to null
        statisticalBarRenderer.setErrorIndicatorPaint(null);
        
        // Get the error indicator paint that was set
        Paint errorIndicatorPaint = statisticalBarRenderer.getErrorIndicatorPaint();
        
        // Verify that the error indicator paint is null
        assertNull(errorIndicatorPaint);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetErrorIndicatorPaintReturningPaintWhereGetTransparencyIsPositive() throws Throwable  {
        // Given a statistical bar renderer instance
        StatisticalBarRenderer renderer = new StatisticalBarRenderer();
        
        // When the error indicator paint is requested
        Color errorIndicatorPaint = (Color) renderer.getErrorIndicatorPaint();
        
        // Then the returned paint object has a blue value of 128
        assertEquals(128, errorIndicatorPaint.getBlue());
    }
  }
  