public static Object replace(Object root, DataIterator it, Object value)
  {
    return transform(root, it, Transforms.constantValue(value));
  }
@Test
  public void testReplaceBySchemaNameNested() throws Exception
  {
    SimpleTestData data = IteratorTestData.createSimpleTestData();

    Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
        .filterBy(Predicates.dataSchemaNameEquals("Bar"))
        .replace(500);

    List<Object> accumulate = new ArrayList<>(Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
        .filterBy(Predicates.pathMatchesPathSpec(new PathSpec("nested", "nested", "foo", PathSpec.WILDCARD)))
        .accumulateValues());

    assertEquals(accumulate.size(), 2);
    assertEquals(accumulate.get(0), 500);
    assertEquals(accumulate.get(1), 500);

    accumulate = new ArrayList<>(Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
        .filterBy(Predicates.pathMatchesPathSpec(new PathSpec("foo", PathSpec.WILDCARD)))
        .accumulateValues());

    assertEquals(accumulate.size(), 3);
    assertEquals(accumulate.get(0), 500);
    assertEquals(accumulate.get(1), 500);
    assertEquals(accumulate.get(2), 500);
  }