code: public static void visitClassHierarchy(ClassVisitor visitor, Class<?> subClass) {
          Class<?> visitedClass = subClass;
          while (visitedClass.getSuperclass() != null) {
              visitor.visit(visitedClass);
              visitedClass = visitedClass.getSuperclass();
          }
      }
docs: Visits the entire class hierarchy from {@code subClass} to {@code Object}.
  
  @param visitor  the visitor to use, must not be {@code null}.
  @param subClass the class whose hierarchy is to be visited, must not be {@code null}.