code: private void generateImmutableToBuilder() {
          if (data.isBuilderGenerated()) {
              if (data.isConstructable()) {
                  List<PropertyGen> nonDerived = nonDerivedProperties();
                  if (nonDerived.size() > 0 || !data.isTypeFinal()) {
                      addLine(1, "/**");
                      addLine(1, " * Returns a builder that allows this bean to be mutated.");
                      addLine(1, " * @return the mutable builder, not null");
                      addLine(1, " */");
                      if (data.isRootClass() == false) {
                          addLine(1, "@Override");
                      }
                      addLine(1, data.getEffectiveBuilderScope() + "Builder" + data.getTypeGenericName(true) + " toBuilder() {");
                      addLine(2, "return new Builder" + data.getTypeGenericDiamond() + "(this);");
                      addLine(1, "}");
                      addBlankLine();
                  }
              } else {
                  addLine(1, "/**");
                  addLine(1, " * Returns a builder that allows this bean to be mutated.");
                  addLine(1, " * @return the mutable builder, not null");
                  addLine(1, " */");
                  if (data.isRootClass() == false) {
                      addLine(1, "@Override");
                  }
                  addLine(1, "public abstract Builder" + data.getTypeGenericName(true) + " toBuilder();");
                  addBlankLine();
              }
          }
      }
docs: -----------------------------------------------------------------------