class ExpressionUtils {

    public static boolean isValid( String expression, Map<String, Object> vars )
    {
        try
        {
            Object result = evaluate( expression, vars, true );

            return result != null;
        }
        catch ( JexlException | NumberFormatException ex )
        {
            // TODO division by zero masking
            return ex.getMessage().contains( "divide error" );
        }
    }

}