code: @Nullable
    public UnixPath getFileName() {
      if (path.isEmpty()) {
        return EMPTY_PATH;
      } else if (isRoot()) {
        return null;
      } else {
        List<String> parts = getParts();
        String last = parts.get(parts.size() - 1);
        return parts.size() == 1 && path.equals(last)
            ? this
            : new UnixPath(permitEmptyComponents, last);
      }
    }
docs: Returns last component in {@code path}.
  
  @see java.nio.file.Path#getFileName()