code: public boolean visitTypeHierarchyObjcOrder(TypeMirror type, TypeVisitor visitor) {
      boolean result = true;
      if (type == null) {
        return result;
      }
      if (type.getKind() == TypeKind.DECLARED) {
        result = visitor.accept((DeclaredType) type);
      }
      // Visit the class type after interface types which is the order the ObjC compiler visits the
      // hierarchy.
      TypeMirror classType = null;
      for (TypeMirror superType : directSupertypes(type)) {
        if (!result) {
          return false;
        }
        if (isClass(superType)) {
          classType = superType;
        } else {
          visitTypeHierarchyObjcOrder(superType, visitor);
        }
      }
      if (classType != null && result) {
        result = visitTypeHierarchyObjcOrder(classType, visitor);
      }
      return result;
    }
docs: Visit all declared types in the order that Objective-C compilation will visit when resolving
  the type signature of a method. Uses a depth-first traversal, visiting interfaces before
  classes.