content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 01:14:27 GMT 2024
   */
  
  package net.sourceforge.beanbin.reflect;
  
  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 java.lang.reflect.Method;
  import java.util.List;
  import net.sourceforge.beanbin.query.Criteria;
  import net.sourceforge.beanbin.reflect.ReflectionSearch;
  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 ReflectionSearch_ESTest extends ReflectionSearch_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testUnion() throws Throwable  {
        // Given: a previous JUnit test that uses ReflectionSearch to get methods from an Object class
        Class<Object> objectClass = Object.class;
        ReflectionSearch reflectionSearch = new ReflectionSearch(objectClass);
        List<Method> methods = reflectionSearch.getMethods();
        
        // When: the list of methods is unioned with itself
        reflectionSearch.union(methods, methods);
        
        // Then: the resulting list should be empty
        assertEquals(0, methods.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMethodsThatHave() throws Throwable  {
        // Create an instance of ReflectionSearch using the Criteria class as the argument
        Class<Criteria> arg0 = Criteria.class;
        ReflectionSearch reflectionSearch = new ReflectionSearch(arg0);
        
        // Create a search that combines multiple conditions using 'or'
        ReflectionSearch or = reflectionSearch.or();
        
        // Search for methods that have the ")" character in their name
        ReflectionSearch methodsThatHave = or.methodsThatHave(")");
        
        // Search for methods that do not have the "net.sourceforge.beanbin.reflect.MethodReflectionCriteria" class as a parameter
        ReflectionSearch methodsThatDontHave = methodsThatHave.methodsThatDontHave("net.sourceforge.beanbin.reflect.MethodReflectionCriteria");
        
        // Get the list of methods that meet both conditions
        List<Method> methods = methodsThatDontHave.getMethods();
        
        // Assert that the list size is 16, as expected
        assertEquals(16, methods.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMethodsReturningListWhereIsEmptyIsFalse() throws Throwable  {
        // Given a class with multiple methods
        Class<Method> arg0 = Method.class;
        
        // When the reflection search is performed to get all methods of the class
        ReflectionSearch reflectionSearch = new ReflectionSearch(arg0);
        List<Method> methods = reflectionSearch.getMethods();
        
        // Then the method returns a list of methods that are not null and not empty
        assertNotNull(methods);
        assertFalse(methods.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHasAnnotation() throws Throwable  {
        // No Comments were added
        Class<Object> arg0 = Object.class;
        ReflectionSearch reflectionSearch = new ReflectionSearch(arg0);
        boolean annotation = reflectionSearch.hasAnnotation("");
        assertFalse(annotation);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAnd() throws Throwable  {
        // Given an instance of ReflectionSearch with a specified argument
        Class<Object> arg0 = Object.class;
        ReflectionSearch reflectionSearch = new ReflectionSearch(arg0);
        
        // When we call the and method on this instance
        ReflectionSearch and = reflectionSearch.and();
        
        // Then the result should be the same instance of ReflectionSearch
        assertSame(and, reflectionSearch);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testOr() throws Throwable  {
        // Create a new ReflectionSearch for the Criteria class
        Class<Criteria> criteriaClass = Criteria.class;
        ReflectionSearch reflectionSearch = new ReflectionSearch(criteriaClass);
        
        // Use the "or" method to create a search that includes methods that don't have a specific criteria
        ReflectionSearch or = reflectionSearch.or();
        
        // Search for methods that don't have a MethodReflectionCriteria criteria
        ReflectionSearch methodsThatDontHave = or.methodsThatDontHave("net.sourceforge.beanbin.reflect.MethodReflectionCriteria");
        
        // Get the list of methods that match the search criteria
        List<Method> methods = methodsThatDontHave.getMethods();
        
        // Assert that the list is not null and contains 16 elements
        assertNotNull(methods);
        assertEquals(16, methods.size());
    }
  }
  