code: public static Set<TypeDef> unrollHierarchy(TypeDef typeDef) {
          if (OBJECT.equals(typeDef)) {
              return new HashSet<>();
          }
          Set<TypeDef> hierarchy = new HashSet<>();
          hierarchy.add(typeDef);
          hierarchy.addAll(typeDef.getExtendsList().stream().flatMap(s -> unrollHierarchy(s.getDefinition()).stream()).collect(Collectors.toSet()));
          return hierarchy;
      }
docs: Unrolls the hierararchy of a specified type.
  @param typeDef       The specified type.
  @return              A set that contains all the hierarching (including the specified type).