private static String internalName(TypeElement typeElement) {
    if (typeElement.getNestingKind().equals(NestingKind.MEMBER)) {
      TypeElement enclosing = MoreElements.asType(typeElement.getEnclosingElement());
      return internalName(enclosing) + "$" + typeElement.getSimpleName();
    }
    return internalName(typeElement.getQualifiedName().toString());
  }
Given a class like {@code foo.bar.Outer.Inner}, produces a string like {@code
"foo/bar/Outer$Inner"}, which is the way the class is referenced in the JVM.
value/src/main/java/com/google/auto/value/processor/ForwardingClassGenerator.java