code: public static Stack<Class<?>> getClassHierarchy(final Class<?> clazz) {
          final Stack<Class<?>> classHierarchy = new Stack<Class<?>>();
          Class<?> c = clazz;
          while (c != null) {
              classHierarchy.push(c);
              c = (isStatic(c.getModifiers())) ? null : c.getEnclosingClass();
          }
          return classHierarchy;
      }
docs: Returns a {@link Stack} of classes, representing the hierarchy of the given {@link Class}.
  
  @param clazz the {@link Class} to retrieve the hierarchy for
  @return the {@link Class} hierarchy