### Question:
Expression { public Row execute(Row input, String expression) { Bindings bindings = ScriptingEnvironmentProvider.create(manager, this.scriptEngineBindings, input); try { this.expressionListener.accept("Executing: " + expression); Object result = this.engine.eval(expression, bindings); this.expressionListener.accept("Got result: " + result); if (!(result instanceof Row)) { return input; } else { return (Row) result; } } catch (ScriptException ex) { throw new IllegalStateException(ex.getMessage(), ex); } } Expression();  Expression(Consumer<String> expressionListener, Map<String, Object> scriptEngineBindings); Row execute(Row input, String expression);  }### Answer:
@Test public void emptyList() { Row row = new Row(); row.addColumn(-1, "chief", "duke"); Row execute = this.cut.execute(row, "$EMPTY"); assertTrue(execute.isEmpty()); }
@Test public void emptyExpression() { Row row = new Row(); row.addColumn(-1, "chief", "duke"); Row result = this.cut.execute(row, ""); assertThat(result, is(row)); }
@Test public void accessToColumn() { Row row = new Row(); final String inputValue = "duke"; row.addColumn(-1, "chief", inputValue); Row result = this.cut.execute(row, "$EMPTY.addColumn(-1,'new_duke',chief.value + '_modified');$EMPTY;"); Column column = result.getColumnByName("new_duke"); assertNotNull(column); Object value = column.getValue(); assertNotNull(value); assertThat(value, is(inputValue + "_modified")); }
@Test public void bindingsAreWorking() { String expression = "print($ROW); print($ROW.numberOfColumns);$ROW"; Row row = new Row(); row.addColumn(-1, "chief", "duke"); row.addColumn(-1, "master", "juggy"); Row execute = this.cut.execute(row, expression); assertFalse(execute.isEmpty()); }