ReflectionUtils { public static <A extends Annotation> List<AnnotatedMethod<A>> getAnnotatedMethods( final Class<A> a, final Class<?> clazz) { Assert.notNull(a, clazz); final List<AnnotatedMethod<A>> annotatedMethods = new ArrayList<>(); Class<?> c = clazz; while (c != Object.class) { final List<Method> allMethods = new ArrayList<>(Arrays.asList(c.getDeclaredMethods())); allMethods.stream().filter(method -> method.isAnnotationPresent(a)).forEach( method -> annotatedMethods .add(new AnnotatedMethod<>(method.getAnnotation(a), method))); c = c.getSuperclass(); } return annotatedMethods; }  static List<AnnotatedMethod<A>> getAnnotatedMethods(
        final Class<A> a, final Class<?> clazz);  }
@Test void getAnnotatedMethods() { final List<ReflectionUtils.AnnotatedMethod<SampleAnnotation>> methodList = ReflectionUtils.getAnnotatedMethods(SampleAnnotation.class, ReflectionUtilsTest.class); Assertions.assertEquals(1, methodList.size()); final ReflectionUtils.AnnotatedMethod<SampleAnnotation> method = methodList.get(0); Assertions.assertNotNull(method); final SampleAnnotation annotation = method.getAnnotation(); Assertions.assertEquals("Hello Schweeden!", annotation.content()); }