### Question:
RuleEngine { public boolean evaluateBooleanExpression(String script, ItemCollection documentContext) throws PluginException { boolean debug = logger.isLoggable(Level.FINE); if ("".equals(script.trim())) return false; scriptEngine.put("workitem", convertItemCollection(documentContext)); if (debug) { logger.finest("......SCRIPT:" + script); } Object result = null; try { result = scriptEngine.eval(script); } catch (ScriptException e) { logger.warning("Script Error in: " + script); throw new PluginException(RuleEngine.class.getSimpleName(), INVALID_SCRIPT, "BusinessRule contains invalid script:" + e.getMessage(), e); } if (result instanceof Boolean) { return (boolean) result; } else { return false; } } RuleEngine();  RuleEngine(final String scriptLanguage); ScriptEngineManager getScriptEngineManager(); ScriptEngine getScriptEngine(); ItemCollection evaluateBusinessRule(String script, ItemCollection documentContext, ItemCollection event); ItemCollection evaluateJsonByScript(String json, String script); boolean evaluateBooleanExpression(String script, ItemCollection documentContext); Object[] evaluateNativeScriptArray(String expression); @SuppressWarnings({ "unchecked", "rawtypes" }) ItemCollection convertScriptVariableToItemCollection(String variable); static final String DEFAULT_SCRIPT_LANGUAGE; static final String INVALID_SCRIPT; }### Answer:
@Test public void testBooleanExpression() throws ScriptException, PluginException { ItemCollection workitem = new ItemCollection(); workitem.replaceItemValue("_budget", 1000); String script = "(workitem._budget && workitem._budget[0]>100)"; boolean result = ruleEngine.evaluateBooleanExpression(script, workitem); Assert.assertTrue(result); script = "(workitem._budget && workitem._budget[0]<=100)"; result = ruleEngine.evaluateBooleanExpression(script, workitem); Assert.assertFalse(result); }