public class TestValueAccumulator
{
@Test
public void testAccumulateByPath() throws Exception
{
SimpleTestData data = IteratorTestData.createSimpleTestData();
List<Object> ids = new LinkedList<Object>();
Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
.filterBy(Predicates.and(Predicates.pathMatchesPattern("foo", Wildcard.ANY_ONE, "id")))
.accumulateValues(ids);
assertEquals(3, ids.size());
assertTrue(ids.contains(1));