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);
  }
@Test
  public void testFromPath() {
    Assert.assertEquals(
        "/absolute/path", AbsoluteUnixPath.fromPath(Paths.get("/absolute/path")).toString());
  }