private static TypeElement topLevelType(TypeElement type) {
    while (type.getNestingKind() != NestingKind.TOP_LEVEL) {
      type = MoreElements.asType(type.getEnclosingElement());
    }
    return type;
  }
Returns the name of the given type, including any enclosing types but not the package.
value/src/main/java/com/google/auto/value/processor/TypeSimplifier.java