code: public static Stream<Class> selfAndSupertypes(final Class type) {
          Class current = type;
          final List<Class> result = new ArrayList<>();
          do {
              result.add(current);
              current = current.getSuperclass();
          } while (current != Object.class);
          return result.stream();
      }
docs: Creates a stream of classes containing the class itself and all its the supertypes (excluding Object.class) of
  the specified type.
  
  @param type
  the type whose supertypes should be returned as a stream
  
  @return stream of the class itself and its supertypes