private Set<Class<?>> getInterfaces(Object object) {
        Set<Class<?>> interfaces = new HashSet<Class<?>>();
        interfaces.addAll(Arrays.asList(object.getClass().getInterfaces()));
        Class<?> clazz = object.getClass();
        while(!clazz.getSuperclass().equals(Object.class)) {
            clazz = clazz.getSuperclass();
            interfaces.addAll(Arrays.asList(clazz.getInterfaces()));
        }
        return interfaces;
    }