content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 14:55:18 GMT 2024
   */
  
  package com.google.common.cache;
  
  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 com.google.common.cache.CacheBuilder;
  import com.google.common.cache.CacheBuilderSpec;
  import java.util.concurrent.TimeUnit;
  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 CacheBuilderSpec_ESTest extends CacheBuilderSpec_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTaking3ArgumentsAndCreatesInitialCapacityParserAndParseTakingStringWithNonEmptyString() throws Throwable  {
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("weakKeys");
        CacheBuilderSpec.InitialCapacityParser cacheBuilderSpec_InitialCapacityParser = new CacheBuilderSpec.InitialCapacityParser();
        try {
        cacheBuilderSpec_InitialCapacityParser.parse(arg0, "weakKeys", "weakKeys");
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // key weakKeys value set to weakKeys, must be integer
        verifyException("com.google.common.cache.CacheBuilderSpec$IntegerParser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToParsableStringReturningNonEmptyString() throws Throwable  {
        // Given a CacheBuilderSpec that specifies weak keys
        CacheBuilderSpec parse = CacheBuilderSpec.parse("weakKeys");
        
        // When the spec is converted to a parsable string
        String parsableString = parse.toParsableString();
        
        // Then the resulting string should contain "weakKeys"
        assertEquals("weakKeys", parsableString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTakingStringThrowsIllegalArgumentException0() throws Throwable  {
        // No Comments were added
        // Undeclared exception!
        try { 
          CacheBuilderSpec.parse("strongKeys");
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // unknown key strongKeys
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesRefreshDurationParserAndCallsParseDuration() throws Throwable  {
        // Test that an exception is thrown when trying to set refreshAfterWrite twice
        CacheBuilderSpec cacheBuilderSpec = CacheBuilderSpec.parse("");
        CacheBuilderSpec.RefreshDurationParser parser = new CacheBuilderSpec.RefreshDurationParser();
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        parser.parseDuration(cacheBuilderSpec, 1L, timeUnit);
        // Undeclared exception!
        try {
        parser.parseDuration(cacheBuilderSpec, 1L, timeUnit);
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        // This is the expected exception, since refreshAfterWrite has already been set
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesWriteDurationParserAndCallsParseDuration() throws Throwable  {
        // rollbacked to evosuite
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("weakKeys");
        CacheBuilderSpec.WriteDurationParser cacheBuilderSpec_WriteDurationParser = new CacheBuilderSpec.WriteDurationParser();
        TimeUnit arg2 = TimeUnit.SECONDS;
        cacheBuilderSpec_WriteDurationParser.parseDuration(arg0, (-811L), arg2);
        // Undeclared exception!
        try { 
          cacheBuilderSpec_WriteDurationParser.parseDuration(arg0, (-811L), arg2);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // expireAfterWrite already set
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseDurationAndCreatesAccessDurationParserAndParseDuration() throws Throwable  {
        // Create a CacheBuilderSpec with "weakKeys" as the cache type
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("weakKeys");
        
        // Create an instance of the AccessDurationParser class
        CacheBuilderSpec.AccessDurationParser cacheBuilderSpec_AccessDurationParser = new CacheBuilderSpec.AccessDurationParser();
        
        // Parse the duration "4271" in days (since the argument is a long value and the default unit is days)
        TimeUnit arg2 = TimeUnit.DAYS;
        cacheBuilderSpec_AccessDurationParser.parseDuration(arg0, 4271L, arg2);
        
        // Assert that the parsed CacheBuilderSpec is equal to "weakKeys" with the specified access duration
        assertEquals("weakKeys", arg0.toParsableString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseDuration() throws Throwable  {
        // Given
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("weakKeys");
        TimeUnit timeUnit = TimeUnit.DAYS;
        arg0.accessExpirationTimeUnit = timeUnit;
        CacheBuilderSpec.AccessDurationParser cacheBuilderSpec_AccessDurationParser = new CacheBuilderSpec.AccessDurationParser();
        
        // When
        try {
        cacheBuilderSpec_AccessDurationParser.parseDuration(arg0, 0L, arg0.accessExpirationTimeUnit);
        } catch (IllegalArgumentException e) {
        // Then
        verifyException("com.google.common.base.Preconditions", e);
        throw e;}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesWriteDurationParserAndCallsParseTaking3Arguments0() throws Throwable  {
        CacheBuilderSpec cacheBuilderSpec = CacheBuilderSpec.parse("");
        CacheBuilderSpec.WriteDurationParser parser = new CacheBuilderSpec.WriteDurationParser();
        try {
        parser.parse(cacheBuilderSpec, "=", "=");
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // key = invalid format.  was =, must end with one of [dDhHmMsS]
        verifyException("com.google.common.cache.CacheBuilderSpec$DurationParser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesRefreshDurationParser() throws Throwable  {
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("weakKeys");
        CacheBuilderSpec.RefreshDurationParser cacheBuilderSpec_RefreshDurationParser = new CacheBuilderSpec.RefreshDurationParser();
        // Undeclared exception!
        try {
        cacheBuilderSpec_RefreshDurationParser.parse(arg0, "weakKeys", "weakKeys");
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        //
        // key weakKeys value set to weakKeys, must be integer
        //
        verifyException("com.google.common.cache.CacheBuilderSpec$DurationParser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTaking3ArgumentsAndCreatesAccessDurationParserAndParseTakingStringWithNonEmptyString() throws Throwable  {
        // rollbacked to evosuite
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("weakKeys");
        CacheBuilderSpec.AccessDurationParser cacheBuilderSpec_AccessDurationParser = new CacheBuilderSpec.AccessDurationParser();
        // Undeclared exception!
        try { 
          cacheBuilderSpec_AccessDurationParser.parse(arg0, "weakKeys", "q8z%?@w4R~Gh");
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // key weakKeys value set to q8z%?@w4R~Gh, must be integer
           //
           verifyException("com.google.common.cache.CacheBuilderSpec$DurationParser", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTaking3ArgumentsAndCreatesWriteDurationParserAndParseTakingStringWithNonEmptyString() throws Throwable  {
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("weakKeys");
        CacheBuilderSpec.WriteDurationParser cacheBuilderSpec_WriteDurationParser = new CacheBuilderSpec.WriteDurationParser();
        // Undeclared exception!
        try {
        // Try to parse the "Fd" value as a write duration
        cacheBuilderSpec_WriteDurationParser.parse(arg0, "Fd", "Fd");
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        // Verify that the expected exception was thrown
        verifyException("com.google.common.cache.CacheBuilderSpec$DurationParser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTaking3ArgumentsAndCreatesAccessDurationParserAndParseTakingStringWithEmptyString() throws Throwable  {
        // Create a new CacheBuilderSpec object using an empty string as its specification
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        
        // Create a new AccessDurationParser object that can parse cache duration specifications
        CacheBuilderSpec.AccessDurationParser parser = new CacheBuilderSpec.AccessDurationParser();
        
        // Try to parse the provided cache duration specification using the AccessDurationParser object
        // This should throw an IllegalArgumentException because the specified duration is not a valid integer
        try {
        parser.parse(arg0, "", "!'Wd<1h;{'7ghmOm");
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the correct exception was thrown and that it contains the expected message
        verifyException("com.google.common.cache.CacheBuilderSpec$DurationParser", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesWriteDurationParserAndCallsParseTaking3Arguments1() throws Throwable  {
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        // Given a cache builder spec with an invalid write duration key
        CacheBuilderSpec.WriteDurationParser cacheBuilderSpec_WriteDurationParser = new CacheBuilderSpec.WriteDurationParser();
        try {
        // When we try to parse the spec with an invalid write duration key
        cacheBuilderSpec_WriteDurationParser.parse(arg0, "d{744F'l+}z*V$zkl%", (String) null);
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Then we expect an IllegalArgumentException to be thrown with a message indicating the invalid write duration key
        assertTrue(e.getMessage().contains("Invalid write duration key"));
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesRecordStatsParserAndCallsParseTaking3Arguments() throws Throwable  {
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        // Given a CacheBuilderSpec object and a String argument representing the cache builder spec
        
        CacheBuilderSpec.RecordStatsParser cacheBuilderSpec_RecordStatsParser = new CacheBuilderSpec.RecordStatsParser();
        // When parsing the record stats option using the RecordStatsParser class
        
        try {
        cacheBuilderSpec_RecordStatsParser.parse(arg0, "", "");
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        // Then an IllegalArgumentException is thrown because the record stats option does not take values
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesConcurrencyLevelParserAndCallsParseInteger() throws Throwable  {
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        CacheBuilderSpec.ConcurrencyLevelParser cacheBuilderSpec_ConcurrencyLevelParser = new CacheBuilderSpec.ConcurrencyLevelParser();
        
        // This line sets the concurrency level to 521.
        cacheBuilderSpec_ConcurrencyLevelParser.parseInteger(arg0, 521);
        
        // This line attempts to set the concurrency level to 521 again, but throws an IllegalArgumentException because the concurrency level has already been set.
        try {
        cacheBuilderSpec_ConcurrencyLevelParser.parseInteger(arg0, 521);
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the exception is an instance of IllegalArgumentException.
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseLongAndParseLongAndParseLong0() throws Throwable  {
        // No Comments were added
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        CacheBuilderSpec.MaximumSizeParser cacheBuilderSpec_MaximumSizeParser = new CacheBuilderSpec.MaximumSizeParser();
        cacheBuilderSpec_MaximumSizeParser.parseLong(arg0, (-88L));
        CacheBuilderSpec.MaximumWeightParser cacheBuilderSpec_MaximumWeightParser = new CacheBuilderSpec.MaximumWeightParser();
        // Undeclared exception!
        try { 
          cacheBuilderSpec_MaximumWeightParser.parseLong(arg0, 0L);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // maximum size was already set to  [-88]
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMaximumWeightParserAndCallsParseLong() throws Throwable  {
        // Test that parsing a maximum weight value twice throws an exception if the first call sets the maximum weight to a non-default value.
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        CacheBuilderSpec.MaximumWeightParser cacheBuilderSpec_MaximumWeightParser = new CacheBuilderSpec.MaximumWeightParser();
        cacheBuilderSpec_MaximumWeightParser.parseLong(arg0, (-544L)); // Sets the maximum weight to  [-544]
        // Undeclared exception!
        try {
        cacheBuilderSpec_MaximumWeightParser.parseLong(arg0, (-1722L)); // Tries to set the maximum weight to  [-1722], but since it was already set to  [-544] in the previous call, this throws an exception.
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        //
        // maximum weight was already set to  [-544]
        //
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseLongAndParseLongAndParseLong1() throws Throwable  {
        // Given a CacheBuilderSpec object arg0, and a maximum weight value 0L.
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        CacheBuilderSpec.MaximumWeightParser cacheBuilderSpec_MaximumWeightParser = new CacheBuilderSpec.MaximumWeightParser();
        cacheBuilderSpec_MaximumWeightParser.parseLong(arg0, 0L);
        
        // When the maximum weight value is set to -1792L.
        CacheBuilderSpec.MaximumSizeParser cacheBuilderSpec_MaximumSizeParser = new CacheBuilderSpec.MaximumSizeParser();
        try {
        cacheBuilderSpec_MaximumSizeParser.parseLong(arg0, (-1792L));
        } catch (IllegalArgumentException e) {
        // Then an IllegalArgumentException is thrown, and the exception message matches the expected message.
        assertEquals("maximum weight was already set to [0]", e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMaximumSizeParserAndCallsParseLong() throws Throwable  {
        // No Comments were added
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        CacheBuilderSpec.MaximumSizeParser cacheBuilderSpec_MaximumSizeParser = new CacheBuilderSpec.MaximumSizeParser();
        cacheBuilderSpec_MaximumSizeParser.parseLong(arg0, 0L);
        // Undeclared exception!
        try { 
          cacheBuilderSpec_MaximumSizeParser.parseLong(arg0, 0L);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // maximum size was already set to  [0]
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesInitialCapacityParserAndCallsParseInteger() throws Throwable  {
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        CacheBuilderSpec.InitialCapacityParser cacheBuilderSpec_InitialCapacityParser = new CacheBuilderSpec.InitialCapacityParser();
        try {
        // This will throw an IllegalArgumentException because the initial capacity was already set to -1632
        cacheBuilderSpec_InitialCapacityParser.parseInteger(arg0, -1632);
        } catch (IllegalArgumentException e) {
        // Verify that the exception is of type IllegalArgumentException and has the expected message
        assertEquals("com.google.common.base.Preconditions", e.getClass().getName());
        assertEquals("initial capacity was already set to [-1632]", e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMaximumSizeParserAndCallsParseTaking3Arguments() throws Throwable  {
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        // Create a new instance of the MaximumSizeParser class from the Guava library
        CacheBuilderSpec.MaximumSizeParser cacheBuilderSpec_MaximumSizeParser = new CacheBuilderSpec.MaximumSizeParser();
        
        // Try to parse the input string using the MaximumSizeParser object
        try {
        // Attempt to parse the input string as a maximum size value
        cacheBuilderSpec_MaximumSizeParser.parse(arg0, "com.google.common.collect.UnmodifiableIterator", "com.google.common.collect.UnmodifiableIterator");
        } catch (IllegalArgumentException e) {
        // Expecting exception: IllegalArgumentException
        fail("Expected an IllegalArgumentException to be thrown");}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesMaximumWeightParserAndCallsParseTaking3Arguments() throws Throwable  {
        // Test that an exception is thrown when trying to parse a null or empty key.
        CacheBuilderSpec.MaximumWeightParser cacheBuilderSpec_MaximumWeightParser = new CacheBuilderSpec.MaximumWeightParser();
        try {
        cacheBuilderSpec_MaximumWeightParser.parse((CacheBuilderSpec) null, "+qfrd?PNg<rlWgEL;(c", "");
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the correct exception is thrown.
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTaking3ArgumentsAndCreatesMaximumWeightParserAndParseTakingString() throws Throwable  {
        CacheBuilderSpec cacheBuilderSpec = CacheBuilderSpec.parse("");
        CacheBuilderSpec.MaximumWeightParser maximumWeightParser = new CacheBuilderSpec.MaximumWeightParser();
        
        // Given a CacheBuilderSpec and a MaximumWeightParser object
        // When the parse method is called with null key
        try {
        maximumWeightParser.parse(cacheBuilderSpec, (String) null, (String) null);
        fail("Expecting exception: IllegalArgumentException");
        
        } catch (IllegalArgumentException e) {
        // Then an IllegalArgumentException is thrown with the message "value of key null omitted"
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTaking3ArgumentsAndCreatesInitialCapacityParserAndParseTaking3Arguments() throws Throwable  {
        // Parse a CacheBuilderSpec that has weak keys and a maximum size of 7.
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("weakKeys,initialCapacity=7");
        
        // Create an InitialCapacityParser to parse the initial capacity value.
        CacheBuilderSpec.InitialCapacityParser cacheBuilderSpec_InitialCapacityParser = new CacheBuilderSpec.InitialCapacityParser();
        
        // Parse the initial capacity value from the CacheBuilderSpec.
        cacheBuilderSpec_InitialCapacityParser.parse(arg0, "7", "7");
        
        // Assert that the parsed initial capacity value is equal to 7.
        assertEquals("weakKeys,initialCapacity=7", arg0.toParsableString());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTaking3ArgumentsAndCreatesInitialCapacityParserAndParseTakingStringWithEmptyString() throws Throwable  {
        CacheBuilderSpec cacheBuilderSpec = CacheBuilderSpec.parse("");
        CacheBuilderSpec.InitialCapacityParser initialCapacityParser = new CacheBuilderSpec.InitialCapacityParser();
        // This is the value of the key "H[fh*|" that we are trying to parse.
        String cacheKey = "H[fh*|";
        
        try {
        initialCapacityParser.parse(cacheBuilderSpec, cacheKey, "");
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // Verify that the correct exception was thrown with the correct message.
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesInitialCapacityParserAndCallsParseTaking3Arguments() throws Throwable  {
        CacheBuilderSpec.InitialCapacityParser parser = new CacheBuilderSpec.InitialCapacityParser();
        try {
        parser.parse((CacheBuilderSpec) null, (String) null, (String) null);
        } catch (IllegalArgumentException e) {
        // value of key null omitted
        verifyException("com.google.common.base.Preconditions", e);
        throw e;}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndParseTakingStringAndEqualsReturningFalse0() throws Throwable  {
        // Create two different CacheBuilderSpec objects with the same refresh time unit in seconds.
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        TimeUnit timeUnit = TimeUnit.SECONDS;
        arg0.refreshTimeUnit = timeUnit;
        
        CacheBuilderSpec parse = CacheBuilderSpec.parse("");
        boolean equals = parse.equals(arg0);
        
        // Assert that the two objects are not equal.
        assertFalse(arg0.equals((Object) parse));
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndParseTakingStringAndEqualsReturningFalse1() throws Throwable  {
        // Given a CacheBuilderSpec with an empty string
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        
        // When the parse method is called with an empty string
        CacheBuilderSpec parse = CacheBuilderSpec.parse("");
        
        // Then the resulting CacheBuilderSpec should be equal to the original one
        assertTrue(parse.equals((Object) arg0));
        
        // Given a TimeUnit of DAYS
        TimeUnit timeUnit = TimeUnit.DAYS;
        
        // When we set the accessExpirationTimeUnit of the parsed CacheBuilderSpec to DAYS
        parse.accessExpirationTimeUnit = timeUnit;
        
        // Then the resulting CacheBuilderSpec should not be equal to the original one
        boolean equals = parse.equals(arg0);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndParseTakingStringAndEqualsReturningFalse2() throws Throwable  {
        // No Comments were added
        CacheBuilderSpec parse = CacheBuilderSpec.parse("");
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        assertTrue(arg0.equals((Object)parse));
        
        TimeUnit timeUnit = TimeUnit.DAYS;
        arg0.writeExpirationTimeUnit = timeUnit;
        boolean equals = parse.equals(arg0);
        assertFalse(arg0.equals((Object)parse));
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTakingStringThrowsIllegalArgumentExceptionAndEquals() throws Throwable  {
        CacheBuilderSpec.parse("");
        // Given an empty string
        
        try {
        CacheBuilderSpec.parse("softValues");
        // When we try to parse a cache builder spec with unknown key "softValues"
        
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        // Then an IllegalArgumentException is thrown with the correct message
        
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndParseTakingStringAndParseTakingStringWithNonEmptyString() throws Throwable  {
        // Given: We have two CacheBuilderSpec instances, parse and arg0
        CacheBuilderSpec parse = CacheBuilderSpec.parse("weakKeys");
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        
        // When: We compare the equality of these two instances using the equals method
        boolean equals = parse.equals(arg0);
        
        // Then: The instances should not be equal, as they have different values for their weak keys option
        assertFalse(arg0.equals((Object)parse));
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsWithNull() throws Throwable  {
        // Test that parsing a null input returns false
        CacheBuilderSpec parse = CacheBuilderSpec.parse("");
        boolean equals = parse.equals((Object) null);
        assertFalse(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndParseTakingStringAndEqualsReturningTrue0() throws Throwable  {
        // Given a CacheBuilderSpec with the same configuration as before
        CacheBuilderSpec spec1 = CacheBuilderSpec.parse("");
        
        // When we compare it to another instance of the same CacheBuilderSpec
        boolean equals = spec1.equals(spec1);
        
        // Then we expect them to be equal
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsAndParseTakingStringAndEqualsReturningTrue1() throws Throwable  {
        // Given
        CacheBuilderSpec cacheBuilderSpec1 = CacheBuilderSpec.parse("");
        CacheBuilderSpec cacheBuilderSpec2 = CacheBuilderSpec.parse("");
        
        // When
        boolean equals = cacheBuilderSpec1.equals(cacheBuilderSpec2);
        
        // Then
        assertTrue(equals);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToCacheBuilderThrowsIllegalArgumentException() throws Throwable  {
        // rollbacked to evosuite
        CacheBuilderSpec parse = CacheBuilderSpec.parse("");
        TimeUnit timeUnit = TimeUnit.MICROSECONDS;
        parse.refreshTimeUnit = timeUnit;
        // Undeclared exception!
        try { 
          parse.toCacheBuilder();
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // duration must be positive: 0 MICROSECONDS
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTakingStringAndToCacheBuilder0() throws Throwable  {
        // Given: a CacheBuilderSpec object with the "weakKeys" option set to true
        CacheBuilderSpec spec = CacheBuilderSpec.parse("weakKeys");
        
        // When: we parse the CacheBuilderSpec and assign it to a CacheBuilder object
        TimeUnit timeUnit = TimeUnit.MINUTES;
        spec.accessExpirationTimeUnit = timeUnit;
        CacheBuilder<Object, Object> cacheBuilder = spec.toCacheBuilder();
        
        // Then: the resulting cache builder should be non-null
        assertNotNull(cacheBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTakingStringAndToCacheBuilder1() throws Throwable  {
        // rollbacked to evosuite
        CacheBuilderSpec parse = CacheBuilderSpec.parse("weakKeys");
        TimeUnit timeUnit = TimeUnit.MICROSECONDS;
        parse.writeExpirationTimeUnit = timeUnit;
        CacheBuilder<Object, Object> cacheBuilder = parse.toCacheBuilder();
        assertNotNull(cacheBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToCacheBuilderThrowsIllegalArgumentExceptionAndCreatesMaximumSizeParser() throws Throwable  {
        // No Comments were added
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        CacheBuilderSpec.MaximumSizeParser cacheBuilderSpec_MaximumSizeParser = new CacheBuilderSpec.MaximumSizeParser();
        cacheBuilderSpec_MaximumSizeParser.parseLong(arg0, (-88L));
        // Undeclared exception!
        try { 
          arg0.toCacheBuilder();
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // maximum size must not be negative
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToCacheBuilderThrowsIllegalArgumentExceptionAndParseTakingStringWithNonEmptyString() throws Throwable  {
        CacheBuilderSpec parse = CacheBuilderSpec.parse("weakKeys");
        Integer integer = new Integer((-8));
        parse.initialCapacity = integer;
        // Given: A cache builder spec with weak keys and a negative initial capacity
        // When: Calling toCacheBuilder() method on the parse object
        // Then: An IllegalArgumentException is thrown with a message indicating that the initial capacity must be non-negative
        try {
        parse.toCacheBuilder();
        fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
        //
        // The message in the exception should be "initialCapacity must be non-negative"
        //
        verifyException("com.google.common.base.Preconditions", e);
        assertTrue(e.getMessage().contains("initialCapacity must be non-negative"));}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTakingStringThrowsIllegalArgumentException1() throws Throwable  {
        // No Comments were added
        // Undeclared exception!
        try { 
          CacheBuilderSpec.parse("=CQ=DQ");
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // key-value pair =CQ=DQ with more than one equals sign
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDisableCachingThrowsIllegalArgumentException() throws Throwable  {
        // Test that disableCaching throws an IllegalArgumentException when passed an unknown key (maximumSize)
        try {
        // Disable caching on the CacheBuilderSpec object
        CacheBuilderSpec.disableCaching();
        fail("Expecting exception: IllegalArgumentException");
        } catch(IllegalArgumentException e) {
        // Verify that the exception is of type IllegalArgumentException and has a specific message
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToString() throws Throwable  {
        // No Comments were added
        CacheBuilderSpec parse = CacheBuilderSpec.parse("weakKeys");
        String string = parse.toString();
        assertEquals("CacheBuilderSpec{weakKeys}", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToParsableStringReturningEmptyString() throws Throwable  {
        // Given a CacheBuilderSpec object with an empty string as the input
        CacheBuilderSpec parse = CacheBuilderSpec.parse("");
        
        // When the toParsableString method is called on this object
        String parsableString = parse.toParsableString();
        
        // Then the output should be an empty string
        assertEquals("", parsableString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCode() throws Throwable  {
        // No Comments were added
        CacheBuilderSpec parse = CacheBuilderSpec.parse("");
        parse.hashCode();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesAccessDurationParserAndCallsParseTaking3Arguments() throws Throwable  {
        CacheBuilderSpec.AccessDurationParser cacheBuilderSpec_AccessDurationParser = new CacheBuilderSpec.AccessDurationParser();
        try {
        cacheBuilderSpec_AccessDurationParser.parse(null, "", "");
        fail("Expecting exception: IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        // value of key omitted
        verifyException("com.google.common.base.Preconditions", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testParseTaking3ArgumentsAndCreatesRecordStatsParserAndParseTaking3Arguments() throws Throwable  {
        // No Comments were added
        CacheBuilderSpec.RecordStatsParser cacheBuilderSpec_RecordStatsParser = new CacheBuilderSpec.RecordStatsParser();
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        cacheBuilderSpec_RecordStatsParser.parse(arg0, (String) null, (String) null);
        // Undeclared exception!
        try { 
          cacheBuilderSpec_RecordStatsParser.parse(arg0, "", (String) null);
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // recordStats already set
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToCacheBuilder() throws Throwable  {
        // No Comments were added
        CacheBuilderSpec.InitialCapacityParser cacheBuilderSpec_InitialCapacityParser = new CacheBuilderSpec.InitialCapacityParser();
        CacheBuilderSpec parse = CacheBuilderSpec.parse("softValues");
        CacheBuilder<Object, Object> cacheBuilder = parse.toCacheBuilder();
        assertNotNull(cacheBuilder);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToCacheBuilderThrowsIllegalArgumentExceptionAndCreatesConcurrencyLevelParser() throws Throwable  {
        // rollbacked to evosuite
        CacheBuilderSpec.ConcurrencyLevelParser cacheBuilderSpec_ConcurrencyLevelParser = new CacheBuilderSpec.ConcurrencyLevelParser();
        CacheBuilderSpec arg0 = CacheBuilderSpec.parse("");
        cacheBuilderSpec_ConcurrencyLevelParser.parseInteger(arg0, 0);
        // Undeclared exception!
        try { 
          arg0.toCacheBuilder();
          fail("Expecting exception: IllegalArgumentException");
        
        } catch(IllegalArgumentException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.google.common.base.Preconditions", e);
        }
    }
  }
  