@Test
public void testPrimitiveValueTemplate() throws Exception {

    Root root = new Root(
            null,
            new Child(null, 1, 2),
            null
    );
    Optional<Object> sanitizedOpt = new TemplateSanitizer(
            path -> path.equals("child.childName") ? Optional.of("ChildGuest") : Optional.empty(),
            type -> true
    ).apply(root);
    assertThat(sanitizedOpt).isPresent();
    Root sanitized = (Root) sanitizedOpt.get();
    assertThat(sanitized.getName()).isNull();
    assertThat(sanitized.getChild().getChildName()).isEqualTo("ChildGuest");
    assertThat(sanitized.getChild().getMin()).isEqualTo(1);
    assertThat(sanitized.getChild().getMax()).isEqualTo(2);
    assertThat(sanitized.getNullableChild()).isNull();
}