ExpressionEvaluatorImpl implements ExpressionEvaluator { private boolean evaluateUnaryBooleanExpression(UnaryBooleanExpression unaryBooleanExpression, DataRow dataRow) { boolean value = evaluateAsOrDefault(unaryBooleanExpression.getValue(), dataRow, Boolean.class, false); switch (unaryBooleanExpression.getUnaryBooleanOperator()) { default: case NOT: return !value; } }  @Override Map<String, Set<String>> getColumnNames(Object expression); @Override T evaluate(Object expression, DataRow dataRow); @Override T evaluateAs(Object expression, DataRow dataRow, Class<T> cls);  }
@Test public void testEvaluateUnaryBooleanExpression() { final SimpleBooleanExpression TRUTHY = new SimpleBooleanExpression(1, EQUAL, 1); final SimpleBooleanExpression FALSY = new SimpleBooleanExpression(1, NOT_EQUAL, 1); assertThat(bool(TRUTHY, NOT), is(false)); assertThat(bool(FALSY, NOT), is(true)); }