docs: public static List<Class> resolveHierarchy(Class<?> type) {
          Class<?> superclass = type.getSuperclass();
          List<Class> hierarchy = new ArrayList<>();
          if (superclass != null) {
              populateHierarchyInterfaces(type, hierarchy);
  
              while (superclass != Object.class) {
                  populateHierarchyInterfaces(superclass, hierarchy);
                  superclass = superclass.getSuperclass();
              }
          } else if (type.isInterface()) {
              populateHierarchyInterfaces(type, hierarchy);
          }
  
          if (type.isArray()) {
              if (!type.getComponentType().isPrimitive()) {
                  hierarchy.add(Object[].class);
              }
          } else {
              hierarchy.add(Object.class);
          }
  
          return hierarchy;
      }