code: public static LinkedHashSet<Class<?>> getSuperclasses(Class<?> clazz) throws ReflectionException {
          Validate.notNull(clazz);
  
          try {
              LinkedHashSet<Class<?>> clazzes = new LinkedHashSet<>();
              if (clazz.getSuperclass() != null) {
                  clazzes.add(clazz.getSuperclass());
                  clazzes.addAll(getSuperclasses(clazz.getSuperclass()));
              }
              return clazzes;
          } catch (Exception e) {
              throw new ReflectionException(e);
          }
      }
docs: Returns all superclasses of the given class ordered top down. The last
  element is always {@link java.lang.Object}.
  
  @param clazz Class to read superclasses from.
  @return {@link LinkedHashSet} of superclasses.
  @throws ReflectionException If superclass can't be read.