code: @Nullable
    public UnixPath getParent() {
      if (path.isEmpty() || isRoot()) {
        return null;
      }
      int index =
          hasTrailingSeparator()
              ? path.lastIndexOf(SEPARATOR, path.length() - 2)
              : path.lastIndexOf(SEPARATOR);
      if (index == -1) {
        return isAbsolute() ? ROOT_PATH : null;
      } else {
        return new UnixPath(permitEmptyComponents, path.substring(0, index + 1));
      }
    }
docs: Returns parent directory (including trailing separator) or {@code null} if no parent remains.
  
  @see java.nio.file.Path#getParent()