code: public static List<Class<?>> getAllClasses(Class<?> clazz) {
          List<Class<?>> types = new ArrayList<>();
          while (clazz != null) {
              types.add(clazz);
              clazz = clazz.getSuperclass();
          }
          return types;
      }
docs: Find all super classes including provided class.
  
  @param clazz the raw class to find super types for
  @return the list of super classes