MultiGroovyMerger extends AbstractGroovyMerger implements MultiPropertyValueMerger<Object> { @Override public Object mergeObjects(List<Object> values, String[] extraParam) { String expression = getExpression(extraParam); Binding binding = new Binding(); binding.setVariable(SOURCES_VARIABLE_NAME, values); return evaluateGroovyScript(binding, expression); }  @Override Object mergeObjects(List<Object> values, String[] extraParam);  }
@Test public void testMultiple() { String[] script = {" sourceValues[0] + sourceValues[1] "}; List values = Arrays.asList(20.2, 9.8); Double expected = 30.0; Double result = (Double) groovyMerger.mergeObjects(values, script); assertEquals("Should be the same result", expected, result, 0.0001); }