code: @Override
      public Path subpath(final int beginIndex, final int endIndex) {
          if (beginIndex < 0) {
              throw new IllegalArgumentException("Begin index must be greater than 0");
          }
          if (endIndex < 0) {
              throw new IllegalArgumentException("End index must be greater than 0");
          }
          if (endIndex <= beginIndex) {
              throw new IllegalArgumentException("End index must be greater than begin index");
          }
          final List<String> tokens = tokenize(this);
          final int tokenCount = tokens.size();
          if (beginIndex >= tokenCount) {
              throw new IllegalArgumentException("Invalid begin index " + endIndex + " for " + this.toString()
                  + "; must be between 0 and " + tokenCount + " exclusive");
          }
          if (endIndex > tokenCount) {
              throw new IllegalArgumentException("Invalid end index " + endIndex + " for " + this.toString()
                  + "; must be between 0 and " + tokenCount + " inclusive");
          }
          final StringBuilder newPathBuilder = new StringBuilder();
          for (int i = 0; i < endIndex; i++) {
              newPathBuilder.append(ArchivePath.SEPARATOR);
              newPathBuilder.append(tokens.get(i));
          }
          final Path newPath = this.fromString(newPathBuilder.toString());
          return newPath;
      }
docs: {@inheritDoc}
  
  @see java.nio.file.Path#subpath(int, int)