docs: @CheckReturnValue
    public Expression build(CodeChunk.Generator codeGenerator) {
      ImmutableList<IfThenPair<Expression>> pairs = conditions.build();
      Expression ternary = tryCreateTernary(pairs);
      if (ternary != null) {
        return ternary;
      }
      // Otherwise we need to introduce a temporary and assign to it in each branch
      VariableDeclaration decl = codeGenerator.declarationBuilder().build();
      Expression var = decl.ref();
      ConditionalBuilder builder = null;
      for (IfThenPair<Expression> oldCondition : pairs) {
        Expression newConsequent = var.assign(oldCondition.consequent);
        if (builder == null) {
          builder = ifStatement(oldCondition.predicate, newConsequent.asStatement());
        } else {
          builder.addElseIf(oldCondition.predicate, newConsequent.asStatement());
        }
      }
      if (trailingElse != null) {
        builder.setElse(var.assign(trailingElse).asStatement());
      }
      return var.withInitialStatements(ImmutableList.of(decl, builder.build()));
    }