code: private void outputFragments(GinjectorBindings bindings,
        FragmentMap fragments, StringBuilder initializeEagerSingletonsBody,
        StringBuilder initializeStaticInjectionsBody, SourceWriteUtil sourceWriteUtil,
        SourceWriter writer) {
      String implClassName = ginjectorNameGenerator.getClassName(bindings);
      NameGenerator nameGenerator = bindings.getNameGenerator();
  
      for (FragmentPackageName fragmentPackageName : fragments.getFragmentPackages()) {
        String fragmentCanonicalClassName =
            nameGenerator.getFragmentCanonicalClassName(implClassName,
                fragmentPackageName);
        String fieldName = nameGenerator.getFragmentFieldName(fragmentPackageName);
        String getterName = nameGenerator.getFragmentGetterMethodName(fragmentPackageName);
  
        // Create the field.
        writer.beginJavaDocComment();
        writer.print("Injector fragment for %s", fragmentPackageName);
        writer.endJavaDocComment();
        writer.print("private %s %s = null;", fragmentCanonicalClassName, fieldName);
  
        // Write the getter.
        writer.beginJavaDocComment();
        writer.print("Getter for injector fragment for %s", fragmentPackageName);
        writer.endJavaDocComment();
        sourceWriteUtil.writeMethod(writer,
            "public " + fragmentCanonicalClassName + " " + getterName + "()", String.format(
            "if (%2$s == null) {\n"
          + "    %2$s = new %1$s(this);\n"
          + "}\n\n"
          + "return %2$s;", fragmentCanonicalClassName, fieldName));
  
        if (fragments.get(fragmentPackageName).hasEagerSingletonInitialization()) {
          initializeEagerSingletonsBody.append(getterName + "().initializeEagerSingletons();\n");
        }
  
        if (fragments.get(fragmentPackageName).hasStaticInjectionInitialization()) {
          initializeStaticInjectionsBody.append(getterName + "().initializeStaticInjections();\n");
        }
      }
    }
docs: For each fragment in the given {@link FragmentMap}, writes the field that
  stores it and a getter for that field, and adds code to invoke the
  fragment's initializers.