@Test
  public void testGetChildValue_childPathMatched() {
    Xpp3Dom root = newXpp3Dom("root", "value");
    Xpp3Dom foo = addXpp3DomChild(root, "foo", "foo");
    addXpp3DomChild(foo, "bar", "bar");

    assertThat(MavenProjectProperties.getChildValue(root, "foo")).isEqualTo(Optional.of("foo"));
    assertThat(MavenProjectProperties.getChildValue(root, "foo", "bar"))
        .isEqualTo(Optional.of("bar"));
    assertThat(MavenProjectProperties.getChildValue(foo, "bar")).isEqualTo(Optional.of("bar"));
  }
Helper for reading back layers in a {@link BuildContext}.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenProjectPropertiesTest.java