code: private ImmutableList<MethodDeclaration> generateStateMethodsForSoyElementClass(
        String soyElementClassName, TemplateStateVar stateVar) {
      JsType jsType = JsType.forIncrementalDomState(stateVar.type());
      String stateAccessorSuffix =
          Ascii.toUpperCase(stateVar.name().substring(0, 1)) + stateVar.name().substring(1);
      Expression stateValue = id("this").dotAccess(STATE_PREFIX + stateVar.name());
      MethodDeclaration getStateMethod =
          MethodDeclaration.create(
              "get" + stateAccessorSuffix,
              JsDoc.builder().addParameterizedAnnotation("return", jsType.typeExpr()).build(),
              Statement.returnValue(stateValue));
  
      jsType = JsType.forIncrementalDomState(stateVar.type());
      ImmutableList.Builder<Statement> setStateMethodStatements = ImmutableList.builder();
      Optional<Expression> typeAssertion =
          jsType.getSoyTypeAssertion(
              id(stateVar.name()), stateVar.name(), templateTranslationContext.codeGenerator());
      if (typeAssertion.isPresent()) {
        setStateMethodStatements.add(typeAssertion.get().asStatement());
      }
      setStateMethodStatements.add(
          stateValue.assign(id(stateVar.name())).asStatement(), Statement.returnValue(id("this")));
      MethodDeclaration setStateMethod =
          MethodDeclaration.create(
              "set" + stateAccessorSuffix,
              JsDoc.builder()
                  .addParam(stateVar.name(), jsType.typeExpr())
                  .addParameterizedAnnotation("return", "!" + soyElementClassName)
                  .build(),
              Statement.of(setStateMethodStatements.build()));
      return ImmutableList.of(getStateMethod, setStateMethod);
    }
docs: Generates `getFoo` (index 0) and `setFoo` (index 1) methods for a given `foo` state variable.