code: private static Stream<Class<?>> getSuperclassesAsStream(Class<?> clazz, boolean includeArgument) {
          return Stream.concat(includeArgument ? Stream.of(clazz) : Stream.empty(),
                               Optional.ofNullable(clazz.getSuperclass())
                                       .map(Stream::of)
                                       .orElseGet(Stream::empty)
                                       .flatMap(superclass -> getSuperclassesAsStream(superclass, true)));
      }
docs: Get a stream of all superclasses of the given class.
  If the given class is an interface, the result will be empty, except if {@code includeArgument} is {@code true}.
  Whether the given class will be included in the result is controlled via the parameter {@code includeArgument}.
  
  @param clazz The class to get the superclasses for.
  @param includeArgument Whether to include the given class in the result.
  @return The stream of superclasses of the given class.