docs: @VisibleForTesting
    static void checkDuplicateHeaderVars(
        ImmutableList<? extends TemplateHeaderVarDefn> params,
        ImmutableList<? extends TemplateHeaderVarDefn> stateVars,
        ErrorReporter errorReporter) {
  
      final Set<String> stateVarNames =
          stateVars.stream().map(TemplateHeaderVarDefn::name).collect(toImmutableSet());
  
      Iterable<? extends TemplateHeaderVarDefn> duplicateVars =
          Iterables.filter(params, param -> stateVarNames.contains(param.name()));
      for (TemplateHeaderVarDefn duplicateVar : duplicateVars) {
        errorReporter.report(duplicateVar.nameLocation(), DUPLICATE_DECLARATION, duplicateVar.name());
      }
    }