docs: private static List<Class<?>> getReverseMethodAttemptOrder(final Class<?> cls) {
          final List<Class<?>> reverseAttemptOrder = new ArrayList<>();
  
          // Iterate from class to its superclasses
          for (Class<?> c = cls; c != null && c != Object.class; c = c.getSuperclass()) {
              reverseAttemptOrder.add(c);
          }
  
          // Find interfaces and superinterfaces implemented by this class or its superclasses
          final Set<Class<?>> addedIfaces = new HashSet<>();
          final LinkedList<Class<?>> ifaceQueue = new LinkedList<>();
          for (Class<?> c = cls; c != null; c = c.getSuperclass()) {
              if (c.isInterface() && addedIfaces.add(c)) {
                  ifaceQueue.add(c);
              }
              for (final Class<?> iface : c.getInterfaces()) {
                  if (addedIfaces.add(iface)) {
                      ifaceQueue.add(iface);
                  }
              }
          }
          while (!ifaceQueue.isEmpty()) {
              final Class<?> iface = ifaceQueue.remove();
              reverseAttemptOrder.add(iface);
              final Class<?>[] superIfaces = iface.getInterfaces();
              if (superIfaces.length > 0) {
                  for (final Class<?> superIface : superIfaces) {
                      if (addedIfaces.add(superIface)) {
                          ifaceQueue.add(superIface);
                      }
                  }
              }
          }
          return reverseAttemptOrder;
      }