code: public static <T> List<Class<?>> getAncestry(final Class<T> c) {
          ConcurrentMap<Class<?>, List<Class<?>>> cache = getClassAncestryCache();
          while (true) {
              List<Class<?>> cachedResult = cache.get(c);
              if (cachedResult != null) {
                  return cachedResult;
              }
              cache.putIfAbsent(c, computeAncestry(c));
          }
      }
docs: <p>Walks superclass and interface graph, superclasses first, then interfaces, to compute an ancestry list. Supertypes are visited
  left
  to right. Duplicates are removed such that no Class will appear in the list before one of its subtypes.</p>
  
  <p>Does not need to be synchronized, races are harmless as the Class graph does not change at runtime.</p>