### Question:
MVELCondition implements Condition { @Override public boolean evaluate(Facts facts) { return (boolean) MVEL.executeExpression(compiledExpression, facts.asMap()); } MVELCondition(String expression);  MVELCondition(String expression, ParserContext parserContext); @Override boolean evaluate(Facts facts);  }### Answer:
@Test public void testMVELExpressionEvaluation() { Condition isAdult = new MVELCondition("person.age > 18"); Facts facts = new Facts(); facts.put("person", new Person("foo", 20)); boolean evaluationResult = isAdult.evaluate(facts); assertThat(evaluationResult).isTrue(); }
@Test(expected = RuntimeException.class) public void whenDeclaredFactIsNotPresent_thenShouldThrowRuntimeException() { Condition isHot = new MVELCondition("temperature > 30"); Facts facts = new Facts(); boolean evaluationResult = isHot.evaluate(facts); }
@Test public void testMVELConditionWithExpressionAndParserContext() { ParserContext context = new ParserContext(); context.addPackageImport("java.util"); Condition condition = new MVELCondition("return new java.util.Random(123).nextBoolean();", context); Facts facts = new Facts(); boolean evaluationResult = condition.evaluate(facts); assertThat(evaluationResult).isTrue(); }