DDMExpressionImpl implements DDMExpression<T> { protected Set<String> getExpressionVariableNames() { return _variables.keySet(); } protected  DDMExpressionImpl(String expressionString); @Override T evaluate(); @Override Expression getModel(); @Override void setVariable(String name, Object value);  }
@Test public void testExpressionVariableNames() throws Exception { DDMExpressionImpl<BigDecimal> ddmExpressionImpl = createDDMExpression( "a - b"); Set<String> variables = new HashSet<String>() { { add("a"); add("b"); } }; Assert.assertEquals( variables, ddmExpressionImpl.getExpressionVariableNames()); }