@VisibleForTesting
  static Optional<String> getChildValue(@Nullable Xpp3Dom dom, String... childNodePath) {
    if (dom == null) {
      return Optional.empty();
    }

    Xpp3Dom node = dom;
    for (String child : childNodePath) {
      node = node.getChild(child);
      if (node == null) {
        return Optional.empty();
      }
    }
    return Optional.ofNullable(node.getValue());
  }
Gets the major version number from a Java version string.

<p>Examples: {@code "1.7" -> 7, "1.8.0_161" -> 8, "10" -> 10, "11.0.1" -> 11}

@param versionString the string to convert
@return the major version number as an integer, or 0 if the string is invalid
jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenProjectProperties.java