@Override
  public JimfsPath subpath(int beginIndex, int endIndex) {
    checkArgument(
        beginIndex >= 0 && endIndex <= names.size() && endIndex > beginIndex,
        "beginIndex (%s) must be >= 0; endIndex (%s) must be <= name count (%s) and > beginIndex",
        beginIndex,
        endIndex,
        names.size());
    return pathService.createRelativePath(names.subList(beginIndex, endIndex));
  }
Equivalent to {@link #getFileSystem()} but with a return type of {@code JimfsFileSystem}.
{@code getFileSystem()}'s return type is left as {@code FileSystem} to make testing paths
easier (as long as methods that access the file system in some way are not called, the file
system can be a fake file system instance).
jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java