code: private void checkDuplicateTokens(MutableTemplateInfo templateInfo) throws TemplateException {
          List<String> allTokenNames = new ArrayList<String>();
          for (TemplateTokenInfo tokenInfo : templateInfo.tokenInfos) {
              if (allTokenNames.contains(tokenInfo.getName())) {
                  throw new TemplateException("Token name '"
                          + tokenInfo.getName() + "' duplicated in template '" +
                          templateInfo.name + "'.");
              } else {
                  allTokenNames.add(tokenInfo.getName());
              }
          }
      }
docs: throws error if a token name appears twice - will bail as soon as one duplicate is hit
  
  @param templateInfo
  @throws TemplateException