public List<Method> getAllAnnotatedMethods(final Class<?> type, final Class<? extends Annotation> annotation) {
        Class<?> klass = type;
        do {
            declaredMethods = klass.getDeclaredMethods();
            final List<Method> allMethods = new ArrayList<Method>(Arrays.asList(declaredMethods));

            for(Method method : allMethods){
                if(annotation == null || method.isAnnotationPresent(annotation)){
                    method.getAnnotation(annotation);
                    methods.add(method);
                }
            }

            klass = klass.getSuperclass();
        } while (klass != Object.class);

        return methods;
    }