WorkflowConditionInterpreter { public static boolean interpret(final String input) throws IllegalArgumentException { final String s = replaceDefaults(input); final WorkflowConditionLexer l = new WorkflowConditionLexer(CharStreams.fromString(s)); l.removeErrorListeners(); final ANTLRErrorListener listener = new BaseErrorListener() { @Override public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) throws ParseCancellationException { throw new IllegalArgumentException("line " + line + ":" + charPositionInLine + " " + msg); } }; final WorkflowConditionParser p = new WorkflowConditionParser(new CommonTokenStream(l)); p.removeErrorListeners(); p.addErrorListener(listener); ParseTree tree = p.booleanExpression(); return new WorkflowConditionBooleanInterpreter().visit(tree); } private  WorkflowConditionInterpreter(); static String replaceVariables(String source, Function<String, String> systemPropertyGetter,
          Map<String, String> properties, boolean quoteStrings); static boolean interpret(final String input);  }
@Test public void interpretTrue() { assertTrue(WorkflowConditionInterpreter.interpret("true")); }
@Test public void interpretNotTrue() { assertFalse(WorkflowConditionInterpreter.interpret("NOT true")); }
@Test public void interpretStringAndNumberAddition() { assertTrue(WorkflowConditionInterpreter.interpret("3+'4' == '34'")); }
@Test public void interpretOr() { assertTrue(WorkflowConditionInterpreter.interpret("false OR true")); }
@Test public void interpretAnd() { assertFalse(WorkflowConditionInterpreter.interpret("false AND true")); }
@Test public void interpretNumericalLessThan() { assertTrue(WorkflowConditionInterpreter.interpret("1.5 < 2")); }
@Test public void interpretNumericalGreaterThan() { assertTrue(WorkflowConditionInterpreter.interpret("3.5 > 2")); }
@Test public void interpretStringEquality() { assertFalse(WorkflowConditionInterpreter.interpret("'a' == 'b'")); }
@Test public void interpretStringInequality() { assertTrue(WorkflowConditionInterpreter.interpret("'a' != 'b'")); }
@Test public void interpretNumericalLessThanWithAddition() { assertTrue(WorkflowConditionInterpreter.interpret("1+1 < 3")); }
@Test public void interpretNumericalLessThanWithMultiplication() { assertFalse(WorkflowConditionInterpreter.interpret("1*4 < 3")); }
@Test public void interpretDecimalLessThan() { assertTrue(WorkflowConditionInterpreter.interpret("485.0 > 50")); }
@Test public void interpretDecimalEquality() { assertTrue(WorkflowConditionInterpreter.interpret("5.0 == 5")); }