public static Set<Class<?>> getImplementedInterfaces(Class<?> cl) {
        Set<Class<?>> interfaces = new HashSet<Class<?>>();
        Deque<Class<?>> classes = new ArrayDeque<Class<?>>();
        classes.add(cl);
        while (!classes.isEmpty()) {
            Class<?> c = classes.pop();
            interfaces.addAll(Arrays.asList(c.getInterfaces()));
            if (c.getSuperclass() != null) {
                classes.add(c.getSuperclass());
            }
            classes.addAll(Arrays.asList(c.getInterfaces()));
        }
        return interfaces;
    }
ReflectionUtils provides Reflection related functionality

@author tiwe
querydsl-core/src/main/java/com/querydsl/core/util/ReflectionUtils.java