MergeFieldsStage mfs = new MergeFieldsStage();
mfs.setOutputField("out");
mfs.setAdditionIfNumbers(true);
mfs.setFromFields(Arrays.asList("in1", "in2", "in3"));
LocalDocument doc = new LocalDocument();
doc.putContentField("in1", 1);
doc.putContentField("in2", 2);
doc.putContentField("in3", 5);
LocalDocument doc2 = new LocalDocument(doc);
mfs.process(doc2);
Assert.assertEquals(1+2+5, doc2.getContentField("out"));
}