public static AbsoluteUnixPath fromPath(Path path) {
    if (path.getRoot() == null) {
      throw new IllegalArgumentException(
          "Cannot create AbsoluteUnixPath from non-absolute Path: " + path);
    }

    List<String> pathComponents = new ArrayList<>(path.getNameCount());
    path.forEach(component -> pathComponents.add(component.toString()));
    return new AbsoluteUnixPath(pathComponents);
  }
Gets a new {@link AbsoluteUnixPath} from a {@link Path}. The {@code path} must be absolute
(indicated by a non-null {@link Path#getRoot}).

@param path the absolute {@link Path} to convert to an {@link AbsoluteUnixPath}.
@return a new {@link AbsoluteUnixPath}
jib-build-plan/src/main/java/com/google/cloud/tools/jib/api/buildplan/AbsoluteUnixPath.java