code: public static Class<?>[] getAllSuperClasses(Class<?> clz) {
      List<Class<?>> list = new ArrayList<>();
      while ((clz = clz.getSuperclass()) != null) {
        list.add(clz);
      }
      return list.toArray(new Class<?>[list.size()]);
    }
docs: Get all super classes
  
  @param clz
  @return