public static Collection<Class<?>> linearize(Class<?> parentClass) {
        List<Class<?>> resultList = new ArrayList<Class<?>>();
        appendAllInterfaces(parentClass, resultList);

        Class<?> superClass = parentClass.getSuperclass();
        while (superClass != null && superClass != Object.class) {
            appendAllInterfaces(superClass, resultList);
            superClass = superClass.getSuperclass();
        }
        return resultList;
    }