content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 16:20:50 GMT 2024
   */
  
  package org.apache.commons.math3.fraction;
  
  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 org.apache.commons.math3.fraction.Fraction;
  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 Fraction_Original_ESTest extends Fraction_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSubtractTakingFractionReturningFractionWhereIntValueIsNegative() throws Throwable  {
        Fraction fraction = Fraction.ONE_HALF;
        Fraction arg0 = fraction.TWO_QUARTERS.reciprocal();
        Fraction subtract = fraction.subtract(arg0);
        assertEquals((-150.0), subtract.percentageValue(), 0.01);
        assertEquals(1, arg0.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPercentageValueReturningZero() throws Throwable  {
        Fraction arg0 = Fraction.MINUS_ONE;
        Fraction fraction = Fraction.ONE;
        Fraction add = fraction.add(arg0);
        double percentageValue = add.percentageValue();
        assertEquals(0.0, percentageValue, 0.01);
        assertEquals(100.0, fraction.percentageValue(), 0.01);
        assertEquals(1, add.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPercentageValueReturningNegative() throws Throwable  {
        Fraction fraction = new Fraction((-359), (-359));
        Fraction negate = fraction.ONE_FIFTH.negate();
        double percentageValue = negate.percentageValue();
        assertEquals((-1), negate.getNumerator());
        assertEquals(100.0, fraction.percentageValue(), 0.01);
        assertEquals((-20.0), percentageValue, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNegateReturningFractionWhereShortValueIsPositive() throws Throwable  {
        Fraction fraction = new Fraction(3088.777495463214, (-806));
        Fraction negate = fraction.MINUS_ONE.negate();
        assertEquals((byte)1, negate.byteValue());
        assertEquals(308800.0, fraction.percentageValue(), 0.01);
        assertEquals(1, negate.getNumerator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNegateReturningFractionWhereShortValueIsNegative() throws Throwable  {
        Fraction fraction = new Fraction(5, 5);
        Fraction negate = fraction.negate();
        assertEquals(1, negate.getDenominator());
        assertEquals(1, fraction.getNumerator());
        assertEquals(1, fraction.getDenominator());
        assertEquals((-1.0F), negate.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingFractionReturningFractionWhereShortValueIsNegative() throws Throwable  {
        Fraction fraction = Fraction.ONE_FIFTH;
        Fraction arg0 = new Fraction((-15));
        Fraction multiply = fraction.ONE_THIRD.multiply(arg0);
        assertEquals(1, arg0.getDenominator());
        assertEquals((-500.0), multiply.percentageValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingIntReturningFractionWherePercentageValueIsPositive() throws Throwable  {
        Fraction fraction = new Fraction(1, (-2236));
        Fraction multiply = fraction.multiply((-1));
        assertEquals((-1), fraction.getNumerator());
        assertEquals(0.044722719141323794, multiply.percentageValue(), 0.01);
        assertEquals((-4.4722718E-4F), fraction.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testLongValueReturningPositive() throws Throwable  {
        Fraction fraction = new Fraction(5, 5);
        long longValue = fraction.longValue();
        assertEquals(1L, longValue);
        assertEquals(1, fraction.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testLongValueReturningNegative() throws Throwable  {
        Fraction fraction = new Fraction(5, 5);
        Fraction subtract = fraction.ONE_FIFTH.subtract(813);
        long longValue = subtract.longValue();
        assertEquals(1, fraction.getNumerator());
        assertEquals((-812.8F), subtract.floatValue(), 0.01F);
        assertEquals(1, fraction.getDenominator());
        assertEquals(5, subtract.getDenominator());
        assertEquals((-812L), longValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIntValueReturningZero() throws Throwable  {
        Fraction fraction = new Fraction(1, (-2236));
        int intValue = fraction.intValue();
        assertEquals((-1), fraction.getNumerator());
        assertEquals((-4.4722718E-4F), fraction.floatValue(), 0.01F);
        assertEquals(0, intValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNumeratorReturningZero() throws Throwable  {
        Fraction fraction = new Fraction(0);
        int numerator = fraction.getNumerator();
        assertEquals(1, fraction.getDenominator());
        assertEquals(0, numerator);
        assertEquals(0.0, fraction.doubleValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNumeratorReturningNegative() throws Throwable  {
        Fraction fraction = new Fraction((-3247), (-3247));
        Fraction subtract = fraction.subtract(Integer.MAX_VALUE);
        int numerator = subtract.getNumerator();
        assertEquals((-2147483646), numerator);
        assertEquals(1, subtract.getDenominator());
        assertEquals(1.0F, fraction.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFloatValueReturningNegative() throws Throwable  {
        Fraction fraction = new Fraction(1, (-2236));
        float floatValue = fraction.floatValue();
        assertEquals((-4.4722718E-4F), floatValue, 0.01F);
        assertEquals(2236, fraction.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDoubleValueReturningPositive() throws Throwable  {
        Fraction fraction = new Fraction(5, 5);
        double doubleValue = fraction.doubleValue();
        assertEquals(1.0, doubleValue, 0.01);
        assertEquals(1, fraction.getNumerator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingFractionReturningFractionWhereShortValueIsNegative() throws Throwable  {
        Fraction fraction = new Fraction((-460));
        Fraction arg0 = fraction.ONE.reciprocal();
        Fraction divide = fraction.MINUS_ONE.divide(arg0);
        assertEquals(1, arg0.getNumerator());
        assertEquals((-100.0), divide.percentageValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingFractionReturningFractionWhereShortValueIsZero() throws Throwable  {
        Fraction arg0 = new Fraction((-201));
        Fraction divide = arg0.TWO_FIFTHS.divide(arg0);
        assertEquals((-0.0019900498F), divide.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingInt() throws Throwable  {
        Fraction fraction = new Fraction((-460));
        Fraction arg0 = fraction.ONE_HALF.divide((-460));
        Fraction divide = arg0.MINUS_ONE.divide(arg0);
        assertEquals((-1), arg0.getNumerator());
        assertEquals(920, divide.getNumerator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFloatValueReturningZero() throws Throwable  {
        Fraction fraction = Fraction.ONE_THIRD;
        Fraction divide = fraction.ZERO.divide(751);
        float floatValue = divide.floatValue();
        assertEquals(0.0F, floatValue, 0.01F);
        assertEquals(1, divide.getDenominator());
        assertEquals(0.3333333333333333, fraction.doubleValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingIntReturningFractionWhereShortValueIsNegative() throws Throwable  {
        Fraction fraction = new Fraction(310, 87);
        Fraction subtract = fraction.ONE_HALF.subtract((-123));
        Fraction divide = subtract.divide((-123));
        assertEquals((-247), divide.getNumerator());
        assertEquals((-1.0040650406504066), divide.doubleValue(), 0.01);
        assertEquals(123L, subtract.longValue());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingFractionReturningFractionWhereByteValueIsNegative() throws Throwable  {
        Fraction fraction = Fraction.ONE_FIFTH;
        Fraction arg0 = new Fraction((-15));
        Fraction add = fraction.add(arg0);
        assertEquals((-14.8), add.doubleValue(), 0.01);
        assertEquals(1, arg0.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingIntReturningFractionWhereShortValueIsPositive() throws Throwable  {
        Fraction fraction = new Fraction((-3247), (-3247));
        Fraction add = fraction.add(1);
        assertEquals(2, add.getNumerator());
        assertEquals(2.0F, add.floatValue(), 0.01F);
        assertEquals(1L, fraction.longValue());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIntValueReturningNegative() throws Throwable  {
        Fraction fraction = new Fraction(3088.777495463214, (-806));
        Fraction add = fraction.FOUR_FIFTHS.add((-806));
        int intValue = add.intValue();
        assertEquals((-4026), add.getNumerator());
        assertEquals(3088L, fraction.longValue());
        assertEquals((-805.2), add.doubleValue(), 0.01);
        assertEquals((-805), intValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetReducedFractionReturningFractionWhereShortValueIsNegative() throws Throwable  {
        Fraction reducedFraction = Fraction.getReducedFraction((-1807), 1);
        assertEquals(1, reducedFraction.getDenominator());
        assertEquals((-1807.0F), reducedFraction.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingFraction() throws Throwable  {
        Fraction arg0 = new Fraction(969, 21);
        Fraction fraction = Fraction.ZERO;
        Fraction multiply = fraction.multiply(arg0);
        assertEquals(323, arg0.getNumerator());
        assertEquals(4614.285714285715, arg0.percentageValue(), 0.01);
        assertEquals(0.0F, multiply.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingFractionReturningFractionWhereShortValueIsPositive() throws Throwable  {
        Fraction arg0 = Fraction.ONE;
        Fraction multiply = arg0.multiply(arg0);
        assertEquals(100.0, multiply.percentageValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNegateReturningFractionWherePercentageValueIsZero() throws Throwable  {
        Fraction fraction = new Fraction(218, 218);
        Fraction negate = fraction.ZERO.negate();
        assertEquals(1, fraction.getNumerator());
        assertEquals(1.0F, fraction.floatValue(), 0.01F);
        assertEquals(0.0, negate.percentageValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDoubleValueReturningNegative() throws Throwable  {
        Fraction fraction = Fraction.MINUS_ONE;
        double doubleValue = fraction.doubleValue();
        assertEquals((-1.0), doubleValue, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFractionTaking2ArgumentsAndCreatesFractionTaking2ArgumentsAndToString() throws Throwable  {
        Fraction fraction = new Fraction(218, 218);
        String string = fraction.toString();
        assertEquals("1", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetReducedFractionThrowsArithmeticException0() throws Throwable  {
        // Undeclared exception!
        try { 
          Fraction.getReducedFraction(Integer.MIN_VALUE, (-706));
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // overflow in fraction -2,147,483,648/-706, cannot negate
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetReducedFractionReturningFractionWhereShortValueIsPositive() throws Throwable  {
        Fraction reducedFraction = Fraction.getReducedFraction(Integer.MIN_VALUE, Integer.MIN_VALUE);
        assertEquals(1, reducedFraction.getDenominator());
        assertEquals(1.0, reducedFraction.doubleValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetReducedFractionThrowsArithmeticException1() throws Throwable  {
        // Undeclared exception!
        try { 
          Fraction.getReducedFraction((-779), Integer.MIN_VALUE);
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // overflow in fraction -779/-2,147,483,648, cannot negate
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetReducedFractionReturningFractionWhereShortValueIsZero() throws Throwable  {
        Fraction reducedFraction = Fraction.getReducedFraction(0, (-1226));
        assertEquals(0, reducedFraction.getNumerator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetReducedFractionWithZero() throws Throwable  {
        // Undeclared exception!
        try { 
          Fraction.getReducedFraction(0, 0);
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // zero denominator in fraction 0/0
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingFractionThrowsArithmeticException() throws Throwable  {
        Fraction arg0 = Fraction.ZERO;
        // Undeclared exception!
        try { 
          arg0.divide(arg0);
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // the fraction to divide by must not be zero: 0/1
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingFractionWithNull() throws Throwable  {
        Fraction fraction = Fraction.TWO_QUARTERS;
        // Undeclared exception!
        try { 
          fraction.divide((Fraction) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // fraction
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingFractionReturningFractionWherePercentageValueIsZero() throws Throwable  {
        Fraction fraction = Fraction.ZERO;
        Fraction arg0 = Fraction.MINUS_ONE;
        Fraction divide = fraction.divide(arg0);
        assertEquals(0.0, divide.percentageValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingFractionWithNull() throws Throwable  {
        Fraction fraction = Fraction.ONE;
        // Undeclared exception!
        try { 
          fraction.multiply((Fraction) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // fraction
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingFractionThrowsArithmeticException() throws Throwable  {
        Fraction arg0 = new Fraction((-220.81));
        Fraction fraction = new Fraction((-2147483645), (-40));
        // Undeclared exception!
        try { 
          fraction.add(arg0);
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // overflow, numerator too large after multiply: 10,737,374,063
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingFraction() throws Throwable  {
        Fraction arg0 = new Fraction((-220.81));
        Fraction add = arg0.add(arg0);
        assertEquals((-44162.0), add.percentageValue(), 0.01);
        assertEquals((-22081), arg0.getNumerator());
        assertEquals(50, add.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSubtractTakingFractionReturningFractionWhereByteValueIsPositive() throws Throwable  {
        Fraction fraction = Fraction.ONE_FIFTH;
        Fraction arg0 = new Fraction((-15));
        Fraction subtract = fraction.subtract(arg0);
        assertEquals(15.2, subtract.doubleValue(), 0.01);
        assertEquals(1, arg0.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingFractionReturningFractionWhereShortValueIsPositive() throws Throwable  {
        Fraction arg0 = new Fraction(5, 5);
        Fraction add = arg0.ONE_THIRD.add(arg0);
        assertEquals(1, arg0.getDenominator());
        assertEquals(1.3333333333333333, add.doubleValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSubtractTakingFractionReturningFractionWhereGetDenominatorIsZero() throws Throwable  {
        Fraction arg0 = Fraction.ZERO;
        Fraction fraction = new Fraction(Double.NaN, 1);
        Fraction subtract = fraction.subtract(arg0);
        assertEquals(1, subtract.getNumerator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingFractionWithFractionWhereShortValueIsZero() throws Throwable  {
        Fraction fraction = new Fraction(969, 21);
        Fraction arg0 = Fraction.ZERO;
        Fraction multiply = fraction.multiply(arg0);
        Fraction add = multiply.add(arg0);
        assertSame(add, arg0);
        assertEquals(46.142857F, fraction.floatValue(), 0.01F);
        assertEquals(7, fraction.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSubtractTakingFraction() throws Throwable  {
        Fraction arg0 = Fraction.TWO_THIRDS;
        Fraction fraction = Fraction.ZERO;
        Fraction subtract = fraction.subtract(arg0);
        assertEquals((-2), subtract.getNumerator());
        assertEquals((-0.6666666666666666), subtract.doubleValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNegateThrowsArithmeticException() throws Throwable  {
        Fraction fraction = new Fraction(Integer.MIN_VALUE);
        // Undeclared exception!
        try { 
          fraction.negate();
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // overflow in fraction -2,147,483,648/1, cannot negate
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndReciprocalAndEqualsReturningTrue() throws Throwable  {
        Fraction arg0 = Fraction.ONE;
        Fraction reciprocal = arg0.reciprocal();
        boolean equals = reciprocal.equals(arg0);
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndReciprocalAndEqualsReturningFalse() throws Throwable  {
        Fraction fraction = Fraction.ONE_HALF;
        Fraction arg0 = fraction.TWO_QUARTERS.reciprocal();
        boolean equals = fraction.equals(arg0);
        assertFalse(equals);
        assertEquals(1, arg0.getDenominator());
        assertEquals((byte)2, arg0.byteValue());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndEqualsReturningFalse() throws Throwable  {
        Fraction arg0 = Fraction.ONE;
        Fraction fraction = Fraction.ONE_THIRD;
        boolean equals = fraction.equals(arg0);
        assertFalse(arg0.equals((Object)fraction));
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndEqualsReturningTrue() throws Throwable  {
        Fraction arg0 = Fraction.ONE_THIRD;
        boolean equals = arg0.equals(arg0);
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsWithNull() throws Throwable  {
        Fraction fraction = new Fraction(5, 5);
        boolean equals = fraction.equals((Object) null);
        assertFalse(equals);
        assertEquals(1, fraction.getNumerator());
        assertEquals(1.0, fraction.doubleValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareToReturningPositive() throws Throwable  {
        Fraction arg0 = Fraction.ONE_FIFTH;
        Fraction fraction = Fraction.THREE_QUARTERS;
        int compareTo = fraction.compareTo(arg0);
        assertEquals(1, compareTo);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareToReturningNegative() throws Throwable  {
        Fraction fraction = Fraction.MINUS_ONE;
        Fraction arg0 = Fraction.THREE_FIFTHS;
        int compareTo = fraction.compareTo(arg0);
        assertEquals((-1), compareTo);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareToReturningZero() throws Throwable  {
        Fraction arg0 = Fraction.ONE_QUARTER;
        int compareTo = arg0.compareTo(arg0);
        assertEquals(0, compareTo);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAbsReturningFractionWhereShortValueIsZero() throws Throwable  {
        Fraction fraction = new Fraction(1, (-2236));
        Fraction abs = fraction.ZERO.abs();
        assertEquals((-1), fraction.getNumerator());
        assertEquals((-0.044722719141323794), fraction.percentageValue(), 0.01);
        assertEquals(0.0, abs.percentageValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAbsReturningFractionWhereShortValueIsPositive() throws Throwable  {
        Fraction fraction = new Fraction((-15));
        Fraction abs = fraction.abs();
        assertEquals((-15L), fraction.longValue());
        assertEquals(1500.0, abs.percentageValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateFractionTaking2ArgumentsThrowsArithmeticException0() throws Throwable  {
        Fraction fraction = null;
        try {
          fraction = new Fraction(Integer.MIN_VALUE, Integer.MIN_VALUE);
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // overflow in fraction -2,147,483,648/-2,147,483,648, cannot negate
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateFractionTaking2ArgumentsThrowsArithmeticException1() throws Throwable  {
        Fraction fraction = null;
        try {
          fraction = new Fraction(2146348014, Integer.MIN_VALUE);
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // overflow in fraction 2,146,348,014/-2,147,483,648, cannot negate
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFailsToCreateFractionTaking2ArgumentsThrowsArithmeticException2() throws Throwable  {
        Fraction fraction = null;
        try {
          fraction = new Fraction(0, 0);
          fail("Expecting exception: ArithmeticException");
        
        } catch(ArithmeticException e) {
           //
           // zero denominator in fraction 0/0
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDoubleValueReturningZero() throws Throwable  {
        Fraction fraction = new Fraction(1.7827257129423813E-8, 0);
        double doubleValue = fraction.doubleValue();
        assertEquals(0.0, doubleValue, 0.01);
        assertEquals(1, fraction.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToString() throws Throwable  {
        Fraction fraction = new Fraction((-1357.16721891));
        String string = fraction.toString();
        assertEquals("-405793 / 299", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFractionTaking2Arguments0() throws Throwable  {
        Fraction fraction = null;
        try {
          fraction = new Fraction((double) 6, 6);
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // illegal state: Overflow trying to convert 6 to fraction (-5/9,223,372,036,854,775,807)
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFractionTaking2Arguments1() throws Throwable  {
        Fraction fraction = null;
        try {
          fraction = new Fraction((double) Integer.MIN_VALUE, Integer.MIN_VALUE);
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // illegal state: Overflow trying to convert -2,147,483,648 to fraction (-2,147,483,648/1)
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFractionTaking2Arguments2() throws Throwable  {
        Fraction fraction = null;
        try {
          fraction = new Fraction((double) (-2147483625), (-2147483625));
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // illegal state: Overflow trying to convert -2,147,483,625 to fraction (-9,223,372,034,707,292,182/9,223,372,036,854,775,807)
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPercentageValueReturningPositive() throws Throwable  {
        Fraction fraction = Fraction.ONE_FIFTH;
        double percentageValue = fraction.percentageValue();
        assertEquals(20.0, percentageValue, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testFloatValueReturningPositive() throws Throwable  {
        Fraction fraction = Fraction.ONE_FIFTH;
        float floatValue = fraction.floatValue();
        assertEquals(0.2F, floatValue, 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNumeratorReturningPositive() throws Throwable  {
        Fraction fraction = Fraction.ONE_QUARTER;
        int numerator = fraction.getNumerator();
        assertEquals(1, numerator);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCode() throws Throwable  {
        Fraction fraction = Fraction.ONE_HALF;
        fraction.hashCode();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIntValueReturningPositive() throws Throwable  {
        Fraction fraction = Fraction.ONE;
        int intValue = fraction.intValue();
        assertEquals(1, intValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSubtractTakingIntReturningFractionWhereShortValueIsZero() throws Throwable  {
        Fraction fraction = new Fraction(1256);
        Fraction subtract = fraction.subtract(1256);
        assertEquals(0.0F, subtract.floatValue(), 0.01F);
        assertEquals(1256.0F, fraction.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFractionTakingDouble() throws Throwable  {
        Fraction fraction = new Fraction(1.7827257129423813E-8);
        assertEquals(0.0F, fraction.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingFractionReturningFractionWhereByteValueIsPositive() throws Throwable  {
        Fraction arg0 = Fraction.ONE_FIFTH;
        Fraction divide = arg0.TWO_THIRDS.divide(arg0);
        assertEquals(3, divide.getDenominator());
        assertEquals(333.33333333333337, divide.percentageValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testLongValueReturningZero() throws Throwable  {
        Fraction fraction = Fraction.ONE_FIFTH;
        long longValue = fraction.longValue();
        assertEquals(20.0, fraction.percentageValue(), 0.01);
        assertEquals(0L, longValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFractionTaking3Arguments() throws Throwable  {
        Fraction fraction = null;
        try {
          fraction = new Fraction(0.29213721752603306, 0.29213721752603306, (-648));
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // illegal state: Unable to convert 0.292 to fraction after -648 iterations
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetField() throws Throwable  {
        Fraction fraction = new Fraction(218, 218);
        fraction.ONE.getField();
        assertEquals(1.0F, fraction.floatValue(), 0.01F);
        assertEquals(1, fraction.getNumerator());
        assertEquals(1, fraction.getDenominator());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReciprocalReturningFractionWhereShortValueIsZero() throws Throwable  {
        Fraction fraction = new Fraction((-15));
        Fraction reciprocal = fraction.reciprocal();
        assertEquals((-0.06666666666666667), reciprocal.doubleValue(), 0.01);
        assertEquals(15, reciprocal.getDenominator());
        assertEquals((-15.0F), fraction.floatValue(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSubtractTakingFractionReturningFractionWherePercentageValueIsZero() throws Throwable  {
        Fraction arg0 = Fraction.TWO_QUARTERS;
        Fraction subtract = arg0.subtract(arg0);
        assertEquals(0.0, subtract.doubleValue(), 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDivideTakingIntReturningFractionWhereShortValueIsPositive() throws Throwable  {
        Fraction fraction = Fraction.ONE;
        Fraction divide = fraction.divide(1);
        assertTrue(divide.equals((Object)fraction));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingIntReturningFractionWhereShortValueIsZero() throws Throwable  {
        Fraction fraction = Fraction.ZERO;
        Fraction add = fraction.add(0);
        assertTrue(add.equals((Object)fraction));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDenominator() throws Throwable  {
        Fraction fraction = new Fraction(218, 218);
        int denominator = fraction.getDenominator();
        assertEquals(100.0, fraction.percentageValue(), 0.01);
        assertEquals(1, denominator);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMultiplyTakingIntReturningFractionWherePercentageValueIsZero() throws Throwable  {
        Fraction fraction = Fraction.ZERO;
        Fraction multiply = fraction.multiply(9);
        assertTrue(multiply.equals((Object)fraction));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAddTakingFractionWithNull() throws Throwable  {
        Fraction fraction = Fraction.TWO_THIRDS;
        // Undeclared exception!
        try { 
          fraction.add((Fraction) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // fraction
           //
           verifyException("org.apache.commons.math3.fraction.Fraction", e);
        }
    }
  }
  