content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 15:32:30 GMT 2024
   */
  
  package com.google.common.base;
  
  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 com.google.common.base.CharMatcher;
  import com.google.common.base.Predicate;
  import com.google.common.base.Predicates;
  import java.util.HashSet;
  import java.util.LinkedHashSet;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Locale;
  import java.util.regex.Pattern;
  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 Predicates_ESTest extends Predicates_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testWithNarrowedType() throws Throwable  {
        // Tests that Predicates.ObjectPredicate.NOT_NULL can be narrowed to a Predicate<CharMatcher>
        Predicates.ObjectPredicate predicates_ObjectPredicate = Predicates.ObjectPredicate.NOT_NULL;
        Predicate<CharMatcher> narrowedPredicate = predicates_ObjectPredicate.withNarrowedType();
        assertNotNull(narrowedPredicate);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDefensiveCopy() throws Throwable  {
        // Create a new LinkedList and add some CharMatcher objects to it
        LinkedList<CharMatcher> arg0 = new LinkedList<CharMatcher>();
        arg0.add(CharMatcher.is('a'));
        arg0.add(CharMatcher.is('b'));
        arg0.add(CharMatcher.is('c'));
        
        // Use the defensiveCopy method to create a copy of the Iterable object
        List<CharMatcher> defensiveCopy = Predicates.defensiveCopy((Iterable<CharMatcher>) arg0);
        
        // Assert that the size of the defensiveCopy list is 3
        assertEquals(3, defensiveCopy.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContains() throws Throwable  {
        // Create a pattern to match any string that contains the substring "plmH?VZp"
        Pattern arg0 = Pattern.compile("plmH?VZp");
        
        // Create a predicate that checks if a given string contains the pattern
        Predicate<CharSequence> contains = Predicates.contains(arg0);
        
        // Assert that the predicate is not null
        assertNotNull(contains);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAssignableFrom() throws Throwable  {
        // Given
        Class<Object> objectClass = Object.class;
        Predicate<Class<?>> assignableFrom = Predicates.assignableFrom(objectClass);
        
        // When
        assertNotNull(assignableFrom);
        
        // Then
        // The test should pass, as the Predicate is not null
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAndTakingPredicateArray() throws Throwable  {
        // rollbacked to evosuite
        Predicates.ObjectPredicate[] arg0 = Predicates.ObjectPredicate.values();
        Predicate<Class<CharMatcher>> and = Predicates.and((Predicate<? super Class<CharMatcher>>[]) arg0);
        assertNotNull(and);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test0() throws Throwable  {
        // No Comments were added
        Predicates.ObjectPredicate predicates_ObjectPredicate = Predicates.ObjectPredicate.NOT_NULL;
        Object arg0 = new Object();
        boolean apply = predicates_ObjectPredicate.apply(arg0);
        assertTrue(apply);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test1() throws Throwable  {
        // Given
        Predicates.ObjectPredicate predicate = Predicates.ObjectPredicate.NOT_NULL;
        
        // When
        boolean apply = predicate.apply(null);
        
        // Then
        assertFalse(apply);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test2() throws Throwable  {
        // No Comments were added
        Predicates.ObjectPredicate predicates_ObjectPredicate = Predicates.ObjectPredicate.IS_NULL;
        boolean apply = predicates_ObjectPredicate.apply((Object) null);
        assertTrue(apply);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNotNull() throws Throwable  {
        // Given
        Predicate<Predicate<Object>> arg0 = Predicates.notNull();
        Predicates.ObjectPredicate predicates_ObjectPredicate = Predicates.ObjectPredicate.IS_NULL;
        
        // When
        boolean apply = predicates_ObjectPredicate.apply(arg0);
        
        // Then
        assertFalse(apply);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualTo() throws Throwable  {
        // Given a Locale.FilteringMode equal to null
        Predicate<Locale.FilteringMode> equalTo = Predicates.equalTo((Locale.FilteringMode) null);
        
        // When the method is called with this filter mode
        assertNotNull(equalTo);
        
        // Then it should return a non-null Predicate
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test3() throws Throwable  {
        // Given
        Predicates.ObjectPredicate arg0 = Predicates.ObjectPredicate.ALWAYS_FALSE;
        
        // When
        CharMatcher forPredicate = CharMatcher.forPredicate(arg0);
        
        // Then
        assertNotNull(forPredicate);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAlwaysTrue() throws Throwable  {
        // Given: A predicate called "arg0" that always returns true
        // When: The predicate is passed to the "forPredicate" method of the CharMatcher class
        // Then: A new instance of CharMatcher should be created, with its predicate set to "arg0"
        
        Predicate<Object> arg0 = Predicates.alwaysTrue();
        CharMatcher forPredicate = CharMatcher.forPredicate(arg0);
        assertNotNull(forPredicate);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void test4() throws Throwable  {
        // rollbacked to evosuite
        Predicates.ObjectPredicate predicates_ObjectPredicate = Predicates.ObjectPredicate.ALWAYS_TRUE;
        Object arg0 = new Object();
        boolean apply = predicates_ObjectPredicate.apply(arg0);
        assertTrue(apply);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testOrTaking2Arguments() throws Throwable  {
        // Arrange
        Predicate<Object> arg1 = Predicates.isNull();
        Predicate<Object> arg0 = Predicates.or((Predicate<? super Object>) arg1, (Predicate<? super Object>) arg1);
        
        // Act
        CharMatcher forPredicate = CharMatcher.forPredicate(arg0);
        
        // Assert
        assertNotNull(forPredicate);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAndTakingIterable() throws Throwable  {
        // Given: a set of 1000 items with a maximum size of 5000
        HashSet<Predicate<Object>> arg0 = new HashSet<>(1000, 5000);
        
        // When: we call the and method with null as an argument
        Predicate<CharMatcher> result = Predicates.and((Iterable<? extends Predicate<? super CharMatcher>>) arg0);
        
        // Then: the result should be null
        assertNull(result);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testOrTakingIterable() throws Throwable  {
        // Given a set of predicates to be combined using "or"
        LinkedHashSet<Predicate<Object>> predicates = new LinkedHashSet<>();
        
        // When we create an or predicate from the set of predicates
        Predicate<Object> orPredicate = Predicates.or((Iterable<? extends Predicate<? super Object>>) predicates);
        
        // Then the or predicate should not be in the original set
        assertFalse(predicates.contains(orPredicate));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContainsPattern() throws Throwable  {
        // No Comments were added
        Predicate<CharSequence> containsPattern = Predicates.containsPattern("");
        assertNotNull(containsPattern);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAlwaysFalse() throws Throwable  {
        // rollbacked to evosuite
        Predicate<Locale.FilteringMode> arg0 = Predicates.alwaysFalse();
        Predicates.ObjectPredicate predicates_ObjectPredicate = Predicates.ObjectPredicate.ALWAYS_FALSE;
        boolean apply = predicates_ObjectPredicate.apply(arg0);
        assertFalse(apply);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsNull() throws Throwable  {
        // Given a Predicate arg0 that represents null
        Predicate<Object> arg0 = Predicates.isNull();
        
        // When we create a CharMatcher for this predicate
        CharMatcher forPredicate = CharMatcher.forPredicate(arg0);
        
        // Then the resulting CharMatcher should not be null
        assertNotNull(forPredicate);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAndTaking2Arguments() throws Throwable  {
        // No Comments were added
        Predicate<Object> arg1 = Predicates.alwaysTrue();
        Predicate<Object> arg0 = Predicates.and((Predicate<? super Object>) arg1, (Predicate<? super Object>) arg1);
        CharMatcher forPredicate = CharMatcher.forPredicate(arg0);
        assertNotNull(forPredicate);
    }
  }
  