code: private static List<Class<?>> getAllSuperclassesAndInterfaces(final Class<?> cls) {
          if (cls == null) {
              return null;
          }
  
          final List<Class<?>> allSuperClassesAndInterfaces = new ArrayList<>();
          final List<Class<?>> allSuperclasses = ClassUtils.getAllSuperclasses(cls);
          int superClassIndex = 0;
          final List<Class<?>> allInterfaces = ClassUtils.getAllInterfaces(cls);
          int interfaceIndex = 0;
          while (interfaceIndex < allInterfaces.size() ||
                  superClassIndex < allSuperclasses.size()) {
              Class<?> acls;
              if (interfaceIndex >= allInterfaces.size()) {
                  acls = allSuperclasses.get(superClassIndex++);
              } else if (superClassIndex >= allSuperclasses.size()) {
                  acls = allInterfaces.get(interfaceIndex++);
              } else if (interfaceIndex < superClassIndex) {
                  acls = allInterfaces.get(interfaceIndex++);
              } else if (superClassIndex < interfaceIndex) {
                  acls = allSuperclasses.get(superClassIndex++);
              } else {
                  acls = allInterfaces.get(interfaceIndex++);
              }
              allSuperClassesAndInterfaces.add(acls);
          }
          return allSuperClassesAndInterfaces;
      }
docs: <p>Gets a combination of {@link ClassUtils#getAllSuperclasses}(Class)} and
  {@link ClassUtils#getAllInterfaces}(Class)}, one from superclasses, one
  from interfaces, and so on in a breadth first way.</p>
  
  @param cls  the class to look up, may be {@code null}
  @return the combined {@code List} of superclasses and interfaces in order
  going up from this one
  {@code null} if null input