code: public AddressTemplate subTemplate(int fromIndex, int toIndex) {
          LinkedList<Token> subTokens = new LinkedList<>();
          subTokens.addAll(this.tokens.subList(fromIndex, toIndex));
          return AddressTemplate.of(join(this.optional, subTokens));
      }
docs: Works like {@link List#subList(int, int)} over the tokens of this template and throws the same exceptions.
  
  @param fromIndex low endpoint (inclusive) of the sub template
  @param toIndex   high endpoint (exclusive) of the sub template
  @return a new address template containing the specified tokens.
  @throws IndexOutOfBoundsException for an illegal endpoint index value
  (<tt>fromIndex &lt; 0 || toIndex &gt; size ||
  fromIndex &gt; toIndex</tt>)