content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Wed Mar 20 04:12:30 GMT 2024
   */
  
  package org.jfree.chart.renderer;
  
  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 org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.jfree.chart.renderer.GrayPaintScale;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class GrayPaintScale_ESTest extends GrayPaintScale_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetUpperBoundReturningPositive() throws Throwable  {
        // Given a gray paint scale with a range of 1.0 to 1.0
        GrayPaintScale grayPaintScale = new GrayPaintScale();
        double lowerBound = grayPaintScale.getLowerBound();
        assertEquals(0.0, lowerBound, 0.01);
        
        // When the upper bound is requested
        double upperBound = grayPaintScale.getUpperBound();
        
        // Then the returned value should be 1.0
        assertEquals(1.0, upperBound, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetUpperBoundReturningNegative() throws Throwable  {
        // Given: A GrayPaintScale object with a negative value for the upper bound
        GrayPaintScale grayPaintScale = new GrayPaintScale(-3203.745350291605, -1.0);
        
        // When: The method getUpperBound() is called on the GrayPaintScale object
        double upperBound = grayPaintScale.getUpperBound();
        
        // Then: The method returns a negative value that is equal to the initial value of the upper bound
        assertEquals(-1.0, upperBound, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPaint() throws Throwable  {
        // Create a GrayPaintScale with the lower bound of -3203.745350291605 and upper bound of -1.0
        GrayPaintScale grayPaintScale = new GrayPaintScale(-3203.745350291605, -1.0);
        
        // Verify that the lower bound is set correctly
        assertEquals(-3203.745350291605, grayPaintScale.getLowerBound(), 0.01);
        
        // Get the paint for the lower bound value and verify that it has a blue value of 0
        Color paint = (Color)grayPaintScale.getPaint(-3203.745350291605);
        assertEquals(0, paint.getBlue());
        
        // Verify that the upper bound is set correctly
        assertEquals(-1.0, grayPaintScale.getUpperBound(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLowerBoundReturningZero() throws Throwable  {
        // Test the GrayPaintScale class with a range of values
        GrayPaintScale grayPaintScale = new GrayPaintScale();
        
        // Check that the lower bound is equal to 0.0 within a tolerance of 0.01
        double lowerBound = grayPaintScale.getLowerBound();
        assertEquals(0.0, lowerBound, 0.01);
        
        // Check that the upper bound is equal to 1.0 within a tolerance of 0.01
        assertEquals(1.0, grayPaintScale.getUpperBound(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLowerBoundReturningPositive() throws Throwable  {
        // Given a GrayPaintScale object with a specified scale and offset values
        GrayPaintScale grayPaintScale = new GrayPaintScale(1.0, 1873.44833047);
        
        // When the getLowerBound method is called on the GrayPaintScale object
        double lowerBound = grayPaintScale.getLowerBound();
        
        // Then the value returned by the method should be equal to the specified offset value
        assertEquals(1873.44833047, grayPaintScale.getUpperBound(), 0.01);
        
        // And the value of the lower bound should also be equal to the specified offset value
        assertEquals(1.0, lowerBound, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningFalse() throws Throwable  {
        // Given two GrayPaintScale objects with different upper bounds
        GrayPaintScale grayPaintScale = new GrayPaintScale();
        GrayPaintScale arg0 = new GrayPaintScale(0.0, 3618.955849567);
        
        // When we call the equals method on one of them
        boolean equals = grayPaintScale.equals(arg0);
        
        // Then they are not equal
        assertFalse(equals);
        
        // And their hash codes are different
        assertNotEquals(grayPaintScale.hashCode(), arg0.hashCode());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesGrayPaintScaleTakingNoArguments() throws Throwable  {
        // Test that two GrayPaintScale objects with the same bounds are equal
        GrayPaintScale grayPaintScale = new GrayPaintScale();
        GrayPaintScale arg0 = new GrayPaintScale((-1574.2658397562986), 1.0);
        assertTrue(grayPaintScale.equals(arg0));
        
        // Test that two GrayPaintScale objects with different bounds are not equal
        arg0 = new GrayPaintScale((-1574.2658397562986 + 1), 1.0);
        assertFalse(grayPaintScale.equals(arg0));
        
        // Test that two GrayPaintScale objects with different upper bounds are not equal
        arg0 = new GrayPaintScale((-1574.2658397562986), 1.0 + 1);
        assertFalse(grayPaintScale.equals(arg0));
        
        // Test that two GrayPaintScale objects with different lower bounds are not equal
        arg0 = new GrayPaintScale((-1574.2658397562986), 1.0);
        assertFalse(grayPaintScale.equals(arg0));
        
        // Test that two GrayPaintScale objects with different bounds and upper/lower bounds are not equal
        arg0 = new GrayPaintScale((-1574.2658397562986 + 1), 1.0 + 1);
        assertFalse(grayPaintScale.equals(arg0));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsWithNonNull() throws Throwable  {
        // Arrange
        GrayPaintScale grayPaintScale = new GrayPaintScale();
        
        // Act
        Object arg0 = new Object();
        boolean equals = grayPaintScale.equals(arg0);
        
        // Assert
        assertEquals(0.0, grayPaintScale.getLowerBound(), 0.01);
        assertEquals(1.0, grayPaintScale.getUpperBound(), 0.01);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningTrue() throws Throwable  {
        // Given a GrayPaintScale object "arg0" with the same bounds as itself
        GrayPaintScale arg0 = new GrayPaintScale(0.0, 1.0);
        
        // When we check for equality with "arg0" itself
        boolean equals = arg0.equals(arg0);
        
        // Then the result should be true, indicating that the object is equal to itself
        assertTrue(equals);
        
        // And the upper and lower bounds of the GrayPaintScale object should match the expected values
        assertEquals(1.0, arg0.getUpperBound(), 0.01);
        assertEquals(0.0, arg0.getLowerBound(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateGrayPaintScaleTaking2ArgumentsThrowsIllegalArgumentException() throws Throwable  {
        // No Comments were added
        GrayPaintScale grayPaintScale = null;
        try {
          grayPaintScale = new GrayPaintScale(1.0, 1.0);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // Requires lowerBound < upperBound.
           //
           verifyException("org.jfree.chart.renderer.GrayPaintScale", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetUpperBoundReturningZero() throws Throwable  {
        // Given a GrayPaintScale with lower bound -2281.74088646 and upper bound 0.0
        GrayPaintScale grayPaintScale = new GrayPaintScale(-2281.74088646, 0.0);
        
        // When we get the lower bound of the scale
        double lowerBound = grayPaintScale.getLowerBound();
        
        // Then the lower bound should be -2281.74088646
        assertEquals(-2281.74088646, lowerBound, 0.01);
        
        // And when we get the upper bound of the scale
        double upperBound = grayPaintScale.getUpperBound();
        
        // Then the upper bound should be 0.0
        assertEquals(0.0, upperBound, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetLowerBoundReturningNegative() throws Throwable  {
        // Given a GrayPaintScale object with negative lower bound and positive upper bound
        GrayPaintScale grayPaintScale = new GrayPaintScale((-3423.820725704), 1564.3976483557835);
        
        // When the getLowerBound method is called
        double lowerBound = grayPaintScale.getLowerBound();
        
        // Then the returned value should be equal to the negative lower bound of the GrayPaintScale object, within 0.01 tolerance
        assertEquals((-3423.820725704), lowerBound, 0.01);
        
        // When the getUpperBound method is called
        double upperBound = grayPaintScale.getUpperBound();
        
        // Then the returned value should be equal to the positive upper bound of the GrayPaintScale object, within 0.01 tolerance
        assertEquals(1564.3976483557835, upperBound, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testClone() throws Throwable  {
        // Tests the equals method of GrayPaintScale with a clone of itself to ensure that the object is equal to its own clone
        GrayPaintScale grayPaintScale = new GrayPaintScale();
        GrayPaintScale arg0 = (GrayPaintScale)grayPaintScale.clone();
        assertTrue(grayPaintScale.equals(arg0));
        // Tests the getLowerBound method of GrayPaintScale to ensure that it returns 0.0 within a tolerance of 0.01
        assertEquals(0.0, arg0.getLowerBound(), 0.01);
        // Tests the getUpperBound method of GrayPaintScale to ensure that it returns 1.0 within a tolerance of 0.01
        assertEquals(1.0, arg0.getUpperBound(), 0.01);
    }
  }
  