content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Tue Mar 19 18:15:33 GMT 2024
   */
  
  package org.javex;
  
  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.util.List;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.javex.Expression;
  import org.javex.ExpressionImpl;
  import org.javex.ExpressionStack;
  import org.javex.FunctionExpression;
  import org.javex.GenericFunctionExpression;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class Expression_ESTest extends Expression_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testDoEvaluationStack() throws Throwable  {
        // Given: An instance of the class "ExpressionImpl" with a specific evaluator
        ExpressionImpl expressionImpl = new ExpressionImpl("org.jave!.evaluators.three.logicaM.StartsWithEvaluator");
        
        // When: The doEvaluationStack method is called on this instance
        expressionImpl.doEvaluationStack();
        
        // Then: The evaluation stack should be executed with the specified evaluator
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExternalFunctionsReturningListWhereIsEmptyIsTrue() throws Throwable  {
        // rollbacked to evosuite
        ExpressionImpl expressionImpl = new ExpressionImpl("/muC7D&");
        ExpressionStack expressionStack = new ExpressionStack();
        expressionImpl.externalFunctions = (List) expressionStack;
        List externalFunctions = expressionImpl.getExternalFunctions();
        assertEquals(0, externalFunctions.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExternalFunctionsReturningListWhereIsEmptyIsFalse() throws Throwable  {
        ExpressionImpl expression = new ExpressionImpl("\"");
        ExpressionStack stack = new ExpressionStack();
        expression.externalFunctions = (List) stack;
        stack.add((Object) "\"");
        List externalFunctions = expression.getExternalFunctions();
        assertEquals(1, externalFunctions.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEvaluate() throws Throwable  {
        // Given a valid input expression "U~:oZi,8$yQL9q:"
        ExpressionImpl expressionImpl = new ExpressionImpl("U~:oZi,8$yQL9q:");
        
        // When the expression is evaluated
        Object evaluate = expressionImpl.evaluate();
        
        // Then the result should be null
        assertNull(evaluate);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsFunction() throws Throwable  {
        // Arrange
        GenericFunctionExpression genericFunctionExpression = new GenericFunctionExpression((String) null);
        
        // Act
        boolean function = genericFunctionExpression.isFunction("+");
        
        // Assert
        assertTrue(function);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFunction() throws Throwable  {
        // Given a valid ExpressionImpl with a function "or"
        ExpressionImpl expression = new ExpressionImpl("wVaoIo");
        FunctionExpression function = expression.getFunction("or");
        
        // When we get the parameter count of the function
        int parameterCount = function.getParameterCount();
        
        // Then we expect the parameter count to be 2
        assertEquals(2, parameterCount);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExternalFunctionWithNull() throws Throwable  {
        // Given: A new ExpressionImpl object with a non-null external function
        ExpressionImpl expressionImpl = new ExpressionImpl("wVaoIo");
        
        // When: Calling getExternalFunction with null input
        FunctionExpression externalFunction = expressionImpl.getExternalFunction((String) null);
        
        // Then: The returned function should be null
        assertNull(externalFunction);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsLogicalFunction() throws Throwable  {
        // No Comments were added
        ExpressionImpl expressionImpl = new ExpressionImpl("\"");
        boolean logicalFunction = expressionImpl.isLogicalFunction("!");
        assertTrue(logicalFunction);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetReservedFunctions() throws Throwable  {
        // Check that the method returns null when given an empty string
        FunctionExpression reservedFunctions = Expression.getReservedFunctions("");
        assertNull(reservedFunctions);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare0() throws Throwable  {
        // No Comments were added
        ExpressionImpl expressionImpl = new ExpressionImpl(",H~\";&Kov-wd66w");
        expressionImpl.prepare();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare1() throws Throwable  {
        // Create a new instance of the ExpressionImpl class with a "," as the delimiter.
        ExpressionImpl expr = new ExpressionImpl(",");
        
        // Prepare the expression by calling the prepare() method.
        expr.prepare();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare2() throws Throwable  {
        // No Comments were added
        ExpressionImpl expressionImpl = new ExpressionImpl(";v5 ");
        expressionImpl.prepare();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare3() throws Throwable  {
        // rollbacked to evosuite
        ExpressionImpl expressionImpl = new ExpressionImpl("gH`4ig'x3kZIjIB.K*");
        expressionImpl.prepare();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepareThrowsNullPointerException() throws Throwable  {
        // Given a GenericFunctionExpression with a null function name
        GenericFunctionExpression genericFunctionExpression = new GenericFunctionExpression(null);
        
        // When the prepare method is called
        try {
        genericFunctionExpression.prepare();
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        // Then an exception is thrown with a message indicating that the function name is null
        assertEquals("Function name cannot be null", e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare4() throws Throwable  {
        // No Comments were added
        ExpressionImpl expressionImpl = new ExpressionImpl("J=_}#j|C'y&\"[P'9bP");
        expressionImpl.prepare();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsExternalFunction() throws Throwable  {
        // Given a non-null string value for the ExpressionImpl instance
        ExpressionImpl expressionImpl = new ExpressionImpl("U~:oZi,8$yQL9q:");
        
        // When the isExternalFunction method is called with null as parameter
        boolean externalFunction = expressionImpl.isExternalFunction((String) null);
        
        // Then the method should return false
        assertFalse(externalFunction);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExternalFunctionThrowsNullPointerException() throws Throwable  {
        ExpressionImpl expressionImpl = new ExpressionImpl("|");
        ExpressionStack expressionStack = new ExpressionStack();
        // Initialize the external functions with a non-null value
        expressionImpl.externalFunctions = (List) expressionStack;
        // Push null onto the stack
        expressionStack.push((Object) null);
        try {
        // Try to get the external function
        expressionImpl.getExternalFunction("org.javex.functions.date.DateAddFunction");
        fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        // Verify that the exception is a null pointer exception and has no message
        assertTrue(e instanceof NullPointerException);
        assertNull(e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExternalFunction() throws Throwable  {
        // Create a new ExpressionImpl instance with an empty string as the input expression
        ExpressionImpl expressionImpl = new ExpressionImpl("");
        
        // Create a new ExpressionStack instance to store the external functions
        ExpressionStack expressionStack = new ExpressionStack();
        
        // Add the ExpressionStack instance to the "externalFunctions" field of the ExpressionImpl instance
        expressionImpl.externalFunctions = (List) expressionStack;
        
        // Get the external function with the name "*", which should be null since it's not defined in the expression
        FunctionExpression externalFunction = expressionImpl.getExternalFunction("*");
        
        // Assert that the external function is null
        assertNull(externalFunction);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsStringFunction() throws Throwable  {
        // Given a GenericFunctionExpression instance with a function name "empty"
        GenericFunctionExpression genericFunctionExpression = new GenericFunctionExpression("{;uM ^J%c'I=Q7zP");
        
        // When the isStringFunction method is called with the parameter "empty"
        boolean stringFunction = genericFunctionExpression.isStringFunction("empty");
        
        // Then the function should not be considered a string function
        assertFalse(stringFunction);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDateFunction() throws Throwable  {
        // Given a GenericFunctionExpression object with the value "or"
        GenericFunctionExpression genericFunctionExpression = new GenericFunctionExpression("");
        
        // When we call the isDateFunction method on this object with the argument "or"
        boolean dateFunction = genericFunctionExpression.isDateFunction("or");
        
        // Then the result should be false
        assertFalse(dateFunction);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsMathFunction() throws Throwable  {
        // Arrange
        ExpressionImpl expression = new ExpressionImpl("wVaoIo");
        
        // Act
        boolean isMathFunction = expression.isMathFunction("or");
        
        // Assert
        assertFalse(isMathFunction);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsReservedFunction() throws Throwable  {
        // Given a GenericFunctionExpression object that represents a function with a comma separator and an arity of 952
        GenericFunctionExpression genericFunctionExpression = new GenericFunctionExpression(",", 952);
        
        // When we call the isReservedFunction method on this expression
        boolean reservedFunction = genericFunctionExpression.isReservedFunction(",");
        
        // Then the result should be false, as the comma separator is not a reserved function in Java
        assertFalse(reservedFunction);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare5() throws Throwable  {
        // rollbacked to evosuite
        ExpressionImpl expressionImpl = new ExpressionImpl("pDfs-j+-[DD");
        expressionImpl.prepare();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare6() throws Throwable  {
        // rollbacked to evosuite
        ExpressionImpl expressionImpl = new ExpressionImpl("D Z(+;^{P;0|U)^/<D");
        expressionImpl.prepare();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare7() throws Throwable  {
        // rollbacked to evosuite
        ExpressionImpl expressionImpl = new ExpressionImpl(">1g(z+L)ZP^oVg6");
        expressionImpl.prepare();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExternalFunctionsReturningNull() throws Throwable  {
        // rollbacked to evosuite
        ExpressionImpl expressionImpl = new ExpressionImpl("/muC7D&");
        List externalFunctions = expressionImpl.getExternalFunctions();
        assertNull(externalFunctions);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testPrepare8() throws Throwable  {
        // rollbacked to evosuite
        ExpressionImpl expressionImpl = new ExpressionImpl(" m,eE");
        expressionImpl.prepare();
    }
  }
  