code: public static String javaClassNameFromSoyTemplateName(String soyTemplate) {
      checkArgument(
          BaseUtils.isDottedIdentifier(soyTemplate), "%s is not a valid template name.", soyTemplate);
      return CLASS_PREFIX + soyTemplate;
    }
docs: Translate a user controlled Soy name to a form that is safe to encode in a java class, method
  or field name.
  
  <p>Soy identifiers are very simple, they are restricted to the following regex: {@code
  [a-zA-Z_]([a-zA-Z_0-9])*}. So a template name is just one or more identifiers separated by
  {@code .} characters. To escape it, we simply replace all '.'s with '_'s, and all '_'s with
  '__' and prefix with a package name.