Path.getRoot() javadoc says:
Returns the root component of this path as a Path object, or null if this path does not have a root component.
Returns:
a path representing the root component of this path, or null
If somePath.toAbsolutePath().getRoot() is called, can users assume getRoot won't return null - at least for the standard Unix and Windows file system provider
Returns the root component of this path as a Path object, or null if this path does not have a root component.
Returns:
a path representing the root component of this path, or null
If somePath.toAbsolutePath().getRoot() is called, can users assume getRoot won't return null - at least for the standard Unix and Windows file system provider